From 5a74a03fece68f6cd53ab2c8fccbd7deea345acb Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 21 Nov 2026 10:53:08 -0300 Subject: test/daemon.py: `--upgrade`'s rows say what they need of the old build instead of failing one run in a few: `far_exec` runs only where OLD's far client dials again when an Upgrade cuts its link with no last word (`redials_far`: PARDES_JOIN_SIZE in OLD's binary, the string of the change that brought that redial, pardes-pair-5's; the redial has no string of its own) and is skipped with a line from the installed build, whose far client took the cut for its session's end one run in five; `pair_exec_reaps` takes its mark before the Upgrade and waits for the blink (its screen left and entered again, the notes drawn after), as `far_exec` does: the mark taken after the client was seen on the new build missed a frame it had drawn by then (from the installed build 2 of 5 runs failed "drawn again" on pardes-merge50's release build and 2 of 5 on this line's, the same before the fix); after: far_exec 5 of 5 between this tree's Debug and ReleaseSafe builds, pair_exec_reaps from the installed build 6 of 6, `--upgrade` from it 3 of 3 Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/daemon.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/daemon.py b/test/daemon.py index fc03e3cb..f4836a43 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -1186,14 +1186,17 @@ def pair_exec_reaps(old, new): wait_for('drawn', lambda: b'line 3 of the notes' in t.text(), timeout=30) install(new, binary) ino = sock.stat().st_ino + # Before the Upgrade: the exec'd client can draw before its exec is seen. + mark = len(t.text()) nine.write('/ctl', b'Upgrade\n') nine.socket.close() wait_for('the session exec\'d', lambda: sock.stat().st_ino != ino, timeout=60) wait_for('the client on the new build', lambda: exe_of(c.pid) == (str(binary), True), timeout=30) nine = reconnect(sock) assert ppid(session) == c.pid - mark = len(t.text()) - wait_for('drawn again', lambda: b'line 3 of the notes' in t.text()[mark:], timeout=30) + # The blink: its screen left and entered again, the notes drawn there. + wait_for('drawn again', lambda: (lambda x: x.rfind(b'\x1b[?1049h') > x.rfind(b'\x1b[?1049l') > mark + and b'line 3 of the notes' in x[x.rfind(b'\x1b[?1049h'):])(t.text()), timeout=30) nine.write('/ctl', b'Exit\n') nine.socket.close() assert c.wait(timeout=30) == 0, c.returncode @@ -3384,6 +3387,14 @@ def keeps_views(binary): return b'away_ns' in Path(binary).read_bytes() +def redials_far(binary): + """Whether a build's far client whose link an Upgrade cuts with no last + word dials again (core/replica.zig `cutListed`'s `far`) rather than take + it for its session's end: the change that made it gave the window its + size at its exec too (PARDES_JOIN_SIZE), the string that says so.""" + return b'PARDES_JOIN_SIZE' in Path(binary).read_bytes() + + def knows_exec(binary): """Whether a build's client execs the build at its start path at an Upgrade, for the view it is handed (PARDES_JOIN_VIEW).""" @@ -3609,7 +3620,10 @@ if __name__ == '__main__': upgrades(old, new) if knows_exec(old): pair_exec_reaps(old, new) - far_exec(old, new) + if redials_far(old): + far_exec(old, new) + else: + print('far exec: skipped: the old build\'s far client, cut at the Upgrade with no last word, takes it for its session\'s end (no PARDES_JOIN_SIZE)') # With a pardes-gui beside each: the clients carried too. if all(a.with_name('pardes-gui').exists() for a in (old, new)): upgrade_clients(old, new) -- cgit v1.3