summaryrefslogtreecommitdiff
path: root/test/daemon.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-08 20:31:50 -0300
committerGabriel Schneider <[email protected]>2026-11-08 21:48:19 -0300
commitaa278d5338a7776cfe4657b5eec9afd7adfaa823 (patch)
tree9c322bc89a066f0ee05849dbe4588f9d8b96d363 /test/daemon.py
parent48903ba5bfd1017377040474ec269197d7ac8eae (diff)
downloadpardes-aa278d5338a7776cfe4657b5eec9afd7adfaa823.tar.gz
pardes-aa278d5338a7776cfe4657b5eec9afd7adfaa823.zip
fix: test/daemon.py --upgrade's fds level counted the second terminal as a view of its own (its terminal and its stub's pipe, two fds) where it joins as a replica client today (one connection, let go at the exec and told to upgrade too): the session lost exactly its three replica connections (ss -xp maps each to its peer), so nothing leaked; the level takes one for a client and two for a view, and the redraw check accepts the client's word
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/daemon.py')
-rw-r--r--test/daemon.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/daemon.py b/test/daemon.py
index 4037d2a8..d4add27f 100644
--- a/test/daemon.py
+++ b/test/daemon.py
@@ -1609,10 +1609,12 @@ def upgrades(old, new):
# (The replicas' connections are two fewer; the state file's one
# more after a build that opened Recent's file for each use, and
# only one: a session holds it once.)
- # A second terminal an older build kept as a view of its own is let
- # go (its terminal and its stub's pipe): two fewer again.
+ # The second terminal: a replica client, its connection let go at
+ # the exec (one fewer), or a view of its own an older build kept,
+ # its terminal and its stub's pipe let go once its stub is told
+ # (two fewer).
def level():
- gone = 2 if stub2.poll() is not None else 0
+ gone = 2 if b'detached from' in term2.text() 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)
@@ -1627,10 +1629,12 @@ def upgrades(old, new):
assert alive(shell_pid) and ppid(shell_pid) == session and alive(sleeper)
# Both terminals drawn again, each its own view.
wait_for('the first terminal redrawn', lambda: b'\x1b[?1049h' in term.text()[before[0]:])
- # The second: a client again, or, a view of an older build's own, let
- # go (a session shows one frontend of its own now), its stub told.
+ # The second: a client again; a replica client of the old build let
+ # go and told to upgrade too, as the third; or, a view of an older
+ # build's own, let go (a session shows one frontend of its own now),
+ # its stub told.
wait_for('the second terminal redrawn or let go', lambda: b'\x1b[?1049h' in term2.text()[before[1]:] or
- (stub2.poll() is not None and b'detached from' in term2.text()))
+ (stub2.poll() is not None and (b'detached from' in term2.text() or b'upgrade this client too' in term2.text())))
wait_for('the word said', lambda: 'Upgrade: now pardes' in screen_text(client))
# The daemon lists the session under its new build.
said = Replica(root / 'pardes-replica.sock').hello('work', new_build)