summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 07:45:13 -0300
committerGabriel Schneider <[email protected]>2026-11-20 08:11:40 -0300
commit58337a33e4661d951f25a844900e95fde3e804a8 (patch)
tree0439194d0cd4b3892a5c61b7dc894b1d24076593
parent4562c2864ade6051206b2aa88e35f472729d06e0 (diff)
downloadpardes-58337a33e4661d951f25a844900e95fde3e804a8.tar.gz
pardes-58337a33e4661d951f25a844900e95fde3e804a8.zip
test: daemon.py's upgrade waits, before its Adopt after kill -9, for the daemon to list the next session (it has taken the hello its `ok` answers): the Adopt otherwise waited daemon.zig `kept`'s 2 s for that `ok` and was refused, 'no pardes daemon is keeping shells' (3 of 40 rounds of the step at a load of 33-37, each refused after 2.2 s; with the wait 0 of 40 at 32-36); the session answering so while its daemon is up is the start's fault, reported
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
-rw-r--r--test/daemon.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/daemon.py b/test/daemon.py
index 59a9c7d1..b846444a 100644
--- a/test/daemon.py
+++ b/test/daemon.py
@@ -2112,10 +2112,17 @@ def upgrades(old, new):
sock = root / 'pardes-9p-again.sock'
wait_for('the next session', sock.exists)
client = Client(sock)
- started.append(int(dict(line.split(maxsplit=1) for line in client.read('/status').decode().splitlines())['pid']))
+ again = int(dict(line.split(maxsplit=1) for line in client.read('/status').decode().splitlines())['pid'])
+ started.append(again)
# Its reader of the daemon starts after its first frame: an Adopt
- # before that waits for an `ok` nobody reads, and is refused.
+ # before that waits for an `ok` nobody reads, and is refused. The
+ # daemon lists it once it has taken its hello, which its `ok`
+ # answers: an Adopt before that waits at most 2 s for the `ok`
+ # (daemon.zig `kept`), which a loaded machine can take (3 in 40 at
+ # a load of 35).
wait_for('the next session\'s first frame', lambda: b'\x1b[?1049h' in term.text())
+ wait_for('the next session listed by the daemon', lambda: f'session again {again} ' in subprocess.run(
+ [str(binary), '--ps'], env=env, capture_output=True, timeout=30).stdout.decode())
before = set(terminals(client))
client.write(f'/pane/{min(before)}/exec', b'Adopt\n')
pane = wait_for('the adopted pane', lambda: set(terminals(client)) - before).pop()