diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-21 06:43:47 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-21 06:44:52 -0300 |
| commit | 649982f866b07f6e2aa6f259c63f3bea8c26c71c (patch) | |
| tree | 1beb70c5a9cbe58f4f0aadf8b13773c39a50eab0 | |
| parent | e29ff73bbb2c198afbb894ee98854da2d9a7be7d (diff) | |
| download | pardes-649982f866b07f6e2aa6f259c63f3bea8c26c71c.tar.gz pardes-649982f866b07f6e2aa6f259c63f3bea8c26c71c.zip | |
test: the upgrade tests ask a client's view again until the layout read is its own: daemon.py's `upgrades` failed once in the release stage of merge47's gate ('its own view again', 4, 5, layout `1 3 2`: neither client's pane) and passed 12 of 12 alone on the same tree: `made_live` makes a client's view the live one ONLY UNTIL THE NEXT INPUT (its own doc), and the session's own terminal (answering the new process's queries late) or the other client's rejoin can be that input before the 9P read of /layout is served; `in_own_view` asks again for 30 s: a view lost lays out neither pane and another's lays out theirs, so neither ever passes; used after an Upgrade in `upgrades` and in `upgrade_clients`; test code only
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| -rw-r--r-- | test/daemon.py | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/test/daemon.py b/test/daemon.py index 2c86c04f..041bc75b 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -399,6 +399,23 @@ def view_panes(client): if line.split()[:1] != ['active'] for x in line.split()[6:]} +def in_own_view(what, live, client, pane, theirs): + """`live()` makes a client's view the live one (made_live, still), and + /layout read after it lays out its pane and not the other client's: + asked again until it does, for a view is the live one only until the + next input (the session's own terminal answering a query late, the + other client's rejoin sizing it). A view lost lays out neither pane, + another's lays out theirs: neither ever passes.""" + def own(): + live() + shown = view_panes(client) + return pane in shown and theirs not in shown + try: + wait_for(what, own, timeout=30) + except TimeoutError: + raise AssertionError((what, pane, theirs, client.read('/layout'))) from None + + def clients(binary): """Replica clients of a detached session: one on the replica socket, one through the delay relay; each one's keys in the session's text and @@ -3161,9 +3178,7 @@ def upgrades(old, new): wait_for('the client joined again', lambda: b'joined again: the session is upgrading' in t.text(), timeout=30) assert again.poll() is None and again5.poll() is None for (t, check), pane, theirs in zip(owners, mine, reversed(mine)): - made_live(t, check) - shown = view_panes(client) - assert pane in shown and theirs not in shown, ('its own view again', pane, theirs, client.read('/layout')) + in_own_view('its own view again', lambda: made_live(t, check), client, pane, theirs) for c, t in ((again, term4), (again5, term5)): c.send_signal(signal.SIGHUP) c.wait(timeout=10) @@ -3332,10 +3347,10 @@ def upgrade_clients(old, new): wait_for('the terminal entered again', lambda: t.text().rfind(b'\x1b[?1049h') > t.text().rfind(b'\x1b[?1049l') > mark, timeout=30) assert tc.poll() is None and w.p.poll() is None for (key, check), pane, theirs in zip(owners, mine, reversed(mine)): - still(check, key) if knows_exec(new): - shown = view_panes(nine) - assert pane in shown and theirs not in shown, ('its own view again', pane, theirs, nine.read('/layout')) + in_own_view('its own view again', lambda: still(check, key), nine, pane, theirs) + else: + still(check, key) print('upgrade with clients: a terminal client and a window client exec\'d the build at their start path, the same processes, ' + ('each back in its own view, its own pane in it' if knows_exec(new) else 'each in a view of its own (that build joins for no view it is handed)')) assert alive(shell_pid) and ppid(shell_pid) == session |
