diff options
| -rw-r--r-- | test/daemon.py | 16 |
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) |
