diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 12:36:59 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 13:09:56 -0300 |
| commit | 9c50dd0b64ecaa8cbcfd4f76868dc83e5b9636e3 (patch) | |
| tree | 1fd44d101a680ed4ff601c8760d2f6bd4139edc0 /test/e2e_harness.zig | |
| parent | 1374e668fe568ad4f7f70c06156c1ecdbb8840b9 (diff) | |
| parent | c8ac386d8f2404417b6d09af1635e1104bcc66ae (diff) | |
| download | pardes-9c50dd0b64ecaa8cbcfd4f76868dc83e5b9636e3.tar.gz pardes-9c50dd0b64ecaa8cbcfd4f76868dc83e5b9636e3.zip | |
integration: the addons' workers and the daemon's notes once, on the five faults a busy machine showed: pardes-services-3 (jobs, draws, pipes and a search through the session's one queue, their workers the queue's; the daemon's notes the loop's own: eight frontend calls; an Adopt's shells kept room in a full queue; a command's exit told after its reads are applied; the tty harness's end of a case) and pardes-merge36 (pardes-faults-5); two conflicts, both where the daemon's reader starts: the faults made daemon.watch() argument-free with daemon.notesTo, the services gave the loop its own note: daemon.notesTo(&l, note) and daemon.watch(); the terminal frontend's quit arm starts no reader (kept does), and Shell.session, whose one reader that line was, is deleted; tui core-test 861/1016 (155 skipped), shell-test 1058/1061, term-test 17/17, both soaks diverged 0, unequal 0, unlisted 0, the window builds; the coordinator's gate in the ledger (reorg/merge37)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/e2e_harness.zig')
| -rw-r--r-- | test/e2e_harness.zig | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/e2e_harness.zig b/test/e2e_harness.zig index f7d65b03..26e942e7 100644 --- a/test/e2e_harness.zig +++ b/test/e2e_harness.zig @@ -149,9 +149,25 @@ pub const Harness = struct { return true; } + /// The app ended as closing its terminal ends it: the master closed (its + /// hangup), the app given `end_ms` to end, SIGKILLed only after, and + /// reaped: what it ends at its own end (its shells, its language servers' + /// groups) does not outlive the case. pub fn deinit(self: *Harness) void { - posix.kill(self.pid, posix.SIG.KILL) catch {}; _ = libc.close(self.master); + const end_ms = 5000; + const until = nowMs() + end_ms; + var status: c_int = 0; + var none: [0]posix.pollfd = .{}; + while (libc.waitpid(self.pid, &status, libc.W.NOHANG) == 0) { + if (nowMs() < until) { + _ = posix.poll(&none, 5) catch 0; + continue; + } + posix.kill(self.pid, posix.SIG.KILL) catch {}; + _ = libc.waitpid(self.pid, &status, 0); + break; + } self.stream.deinit(); self.gpa.destroy(self.raw); self.term.deinit(self.gpa); |
