summaryrefslogtreecommitdiff
path: root/test/fs.py
diff options
context:
space:
mode:
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 270ac367..11233e80 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -1397,6 +1397,22 @@ def test(binary, quic=False):
assert time.monotonic() - deleted < .05, time.monotonic() - deleted
assert second.wait(timeout=5) == 0
assert edited.read_bytes() == b'edited\n'
+ # --wait from outside the session's panes, $PARDES_9P alone (an
+ # agent's EDITOR): asked of the session, not a screen of its own.
+ outside_env = {k: v for k, v in env.items() if k not in ('PARDES_PANE', 'PARDES_PID')}
+ far = root / 'wait far.txt'
+ far.write_bytes(b'far\n')
+ before = serials()
+ waiting = subprocess.Popen([binary, '--wait', str(far)], cwd=root, env=outside_env,
+ stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
+ deadline = time.monotonic() + 5
+ while not serials() - before and time.monotonic() < deadline:
+ time.sleep(.01)
+ far_pane, = serials() - before
+ time.sleep(.3)
+ assert waiting.poll() is None, waiting.stderr.read()
+ client.remove(f'/pane/{far_pane}')
+ assert waiting.wait(timeout=5) == 0
# `--` ends the options: a name starting with a dash is a name.
dash = root / '-dash.txt'
dash.write_bytes(b'dash\n')