From bed515689a5e09ed704de9206877ec7c0a32ab3a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 20:49:13 -0300 Subject: fs.py waits for a new file's pane to be named, not only made pardes --wait NEWFILE reads pane/new and then writes the pane's name, two requests; the test checked /index for the name as soon as the pane showed, and a gate run caught it between them. It waits for the name now. Co-Authored-By: Claude Opus 5.5 --- test/fs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/fs.py') diff --git a/test/fs.py b/test/fs.py index 36ba180d..06643385 100644 --- a/test/fs.py +++ b/test/fs.py @@ -1281,13 +1281,14 @@ def test(binary, quic=False): before = serials() made = subprocess.Popen([binary, '--wait', fresh.name], cwd=root, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) + # The launch makes the pane (pane/new), then names it: wait for + # the name, not the pane. deadline = time.monotonic() + 3 - while not serials() - before: + while str(fresh).encode() not in client.read('/index'): assert made.poll() is None, made.stderr.read() - assert time.monotonic() < deadline, 'a new name opened no pane' + assert time.monotonic() < deadline, 'a new name opened no pane named it' time.sleep(.01) named, = serials() - before - assert str(fresh).encode() in client.read('/index') client.write(f'/pane/{named}/body', b'new\n') execute(client, named, 'Save') client.remove(f'/pane/{named}') -- cgit v1.3