From d321916267fc4f0f2d82fbe1fd0d37292d24456b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 23:28:30 -0300 Subject: 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 --- test/fs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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'), -- cgit v1.3