summaryrefslogtreecommitdiff
path: root/test/fs.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 23:28:30 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commitd321916267fc4f0f2d82fbe1fd0d37292d24456b (patch)
tree791ec6c1b5b3173f8443e81a4873d673e1bda117 /test/fs.py
parentfd448801b83bdddf27a1d9af17bf8581356b2b35 (diff)
downloadpardes-d321916267fc4f0f2d82fbe1fd0d37292d24456b.tar.gz
pardes-d321916267fc4f0f2d82fbe1fd0d37292d24456b.zip
fs-test checks an unattended detached session expires its messages on its own
Round 7 saw messages linger for minutes in a detached session. With nothing attached they do expire, on the session's own clock (nextWake schedules the look, expireUnattended drops them); the merge did not regress it, and a session driven only over 9P now has a test that it does, with no request in between. With a frontend attached a message stays until its next key or click, as config.md and detached.md say; the lingering the agent saw is that. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/fs.py')
-rw-r--r--test/fs.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/fs.py b/test/fs.py
index 67edf01e..890e75f6 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -451,6 +451,21 @@ def exit_answers(binary):
raise AssertionError("Exit did not quit the editor")
+def unattended_messages_expire(binary):
+ """With nothing attached, a message leaves after MessageLinger on its own
+ clock: no key, no click, no other request comes to move it along."""
+ with tempfile.TemporaryDirectory(prefix='pardes-msg-') as directory:
+ with session(binary, Path(directory), 'msg') as (client, _):
+ client.write('/pane/1/ctl', b'Msg lingering-words\n')
+ def shown():
+ screen = json.loads(client.read('/screen'))
+ return 'lingering-words' in ''.join(cell[0] for cell in screen['cells'])
+ assert shown()
+ # Reading /screen is itself a request, so wait without asking.
+ time.sleep(2.5)
+ assert not shown(), 'an unattended message outlived MessageLinger'
+
+
def signal_cleans_up(binary):
"""A detached session told to stop by a signal unlinks its sockets."""
for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGHUP]:
@@ -471,6 +486,7 @@ def test(binary, quic=False):
started = time.monotonic()
run_file(binary)
exit_answers(binary)
+ unattended_messages_expire(binary)
signal_cleans_up(binary)
for options, message in [
(['--fs'], b'no such option'),