From 1ab1d412e2768d9fe56a9e97ab60716a6d31063a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 23:00:16 -0300 Subject: A second pardes --detach=NAME while NAME runs says "a session named NAME is already running" and exits 1, with no error trace The second session built its whole core before its bind failed, then returned an error that main printed with a Zig error-return trace. The name is now checked first: a live session's socket is said, and the process exits 1 having made nothing. Co-Authored-By: Claude Opus 5.5 --- test/fs.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/fs.py b/test/fs.py index 2782407d..8d830c48 100644 --- a/test/fs.py +++ b/test/fs.py @@ -1306,6 +1306,14 @@ def test(binary, quic=False): # opened is deleted, as an $EDITOR must; one on a file already open # waits on that pane; a session that goes away ends it with 1. with session(binary, root, 'wait') as (client, address): + # A second --detach of a name a live session holds: said, exit 1, + # no Zig error trace. + second_env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_')} + second_env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root)) + second = subprocess.run([binary, '--detach=wait'], cwd=root, env=second_env, + stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, timeout=20) + assert second.returncode == 1, second + assert second.stderr == b'pardes: a session named wait is already running\n', second.stderr status = dict(line.split(maxsplit=1) for line in client.read('/status').decode().splitlines()) env = {k: v for k, v in os.environ.items() if k != 'PARDES_FORWARD_LOOK'} env.update(PARDES_9P=str(address), PARDES_PANE='1', PARDES_PID=status['pid']) -- cgit v1.3