summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/daemon.py20
1 files changed, 17 insertions, 3 deletions
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)