summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 11:15:26 -0300
committerGabriel Schneider <[email protected]>2026-11-20 12:42:13 -0300
commit2e0eb4d7e2364a8cfe97eb56314af0b4be36be9b (patch)
tree39784e0c093906fbc22ae04e2cffb5ae79422345 /test
parentc6234f250ee6f94bdeb57e1d77045d74149325fa (diff)
downloadpardes-2e0eb4d7e2364a8cfe97eb56314af0b4be36be9b.tar.gz
pardes-2e0eb4d7e2364a8cfe97eb56314af0b4be36be9b.zip
upgrade: an Upgrade carries near clients (the last step's design 1.4, Z3): a client let go by an Upgrade dials again as before, and when the session runs another build (or another protocol) and a newer file is installed at its own start path since it started (upgrade.replaced), the client loop ends `.upgrade` and its frontend lets its screen go and execs that file as `--attach=<socket>:<name>` (client.zig execAgain), the same process, for the view the session kept for it (PARDES_JOIN_VIEW, Options.join_view, dialled patiently as a rejoin is): the terminal's is the blink (it leaves the alternate screen and enters it again; no record), the window a new window; a client whose start path holds no newer file keeps today's sentence "session upgraded to a newer pardes: upgrade this client too"; a far client the same, through its forward (PARDES_REPLICA_FAR=1); a pair with no daemon refuses the Upgrade in words ("no daemon keeps this session, so its client could not join it again"), since its first client has no socket to find the session again by (on the base the Upgrade cut the client off and ended the session); test/daemon.py upgrade_clients (a terminal client and a window client, each its own pane in its own view): old->new the base's clients are let go and told to upgrade too (what they do today), new->old they exec the base build and come back in a view of their own (the base reads no PARDES_JOIN_VIEW), new->(this built with -Dembed-sources, another semantics) each is back in ITS view with its own pane; `pair`'s no-daemon Upgrade refused; tui core-test 858/1013 (155 skipped), shell-test 1053/1056, term 17/17, pane 183/184, kitty 45/45, behaviour 275/275 and --replay 275/275, process-test 0 of 144 failed, both soaks diverged 0 unequal 0 corpus 22, daemon.py plain, --far, --games, --window-clients, --gui, --upgrade both ways (with clients) pass, gui unit-test 1650/1654 (the perf check's BaselineHarnessMismatch its one failure), macOS lib (Linux host), aarch64-macos, FreeBSD build (loads 3-15)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test')
-rw-r--r--test/daemon.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/daemon.py b/test/daemon.py
index 1daebea8..26508a0b 100644
--- a/test/daemon.py
+++ b/test/daemon.py
@@ -649,12 +649,16 @@ def pair(binary):
c2 = lone.spawn([binary, '--9p=lone', str(notes)], dict(env, PARDES_DAEMON='off'))
nine2, session2 = session_of('lone')
wait_for('the lone pair drawn', lambda: b'line 3 of the notes' in lone.text(), timeout=30)
+ # An Upgrade refused, with why: its client could not find it again.
+ nine2.write('/ctl', b'Upgrade\n')
+ wait_for('the Upgrade refused', lambda: 'its client could not join it again' in screen_text(nine2), timeout=20)
+ assert alive(session2) and c2.poll() is None
nine2.socket.close()
os.kill(c2.pid, signal.SIGKILL)
c2.wait(timeout=10)
wait_for('the lone session ended with its last link', lambda: not alive(session2), timeout=20)
wait_for('nothing left', lambda: not [p for p in processes(root) if alive(p)], timeout=20)
- print(f'pair: with no daemon, client {c2.pid} killed outright, its session {session2} ended; nothing left behind')
+ print(f'pair: with no daemon, an Upgrade refused in words; client {c2.pid} killed outright, its session {session2} ended; nothing left behind')
finally:
for p in processes(root):
try:
@@ -2303,7 +2307,9 @@ def upgrades(old, new):
# its terminal and its stub's pipe let go once its stub is told
# (two fewer).
def level():
- gone = 2 if b'detached from' in term2.text() else 1
+ # (A client of a build that execs at an Upgrade comes back: its
+ # connection is the session's again.)
+ gone = 2 if b'detached from' in term2.text() else 0 if knows_exec(old) and stub2.poll() is None else 1
return fds_before[0] - 2 - gone + min(state_fds(session), 1) - state_before, fds_before[1]
try:
wait_for('the fds level', lambda: (fds(session), fds(daemon)) == level(), timeout=5)
@@ -2414,7 +2420,10 @@ def upgrades(old, new):
install(new, binary)
os.kill(session, signal.SIGKILL)
stub.wait(timeout=10)
- stub2.wait(timeout=10)
+ try:
+ stub2.wait(timeout=30)
+ except subprocess.TimeoutExpired:
+ raise AssertionError(('the second terminal\'s client on', cmdline(stub2.pid), term2.text()[-1200:]))
client.socket.close()
term.close()
term2.close()