diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 03:35:43 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | d067c77813f9ce9fcc64b33e6b0284510ac02185 (patch) | |
| tree | eb530db7320603af748aa7535c93090a36b78134 /test | |
| parent | 3e941015ebd2da88a296479f407e9bbf06287234 (diff) | |
| download | pardes-d067c77813f9ce9fcc64b33e6b0284510ac02185.tar.gz pardes-d067c77813f9ce9fcc64b33e6b0284510ac02185.zip | |
A REPL paste's Enter waits on the clock, not on stale core time
sendToRepl timed the Enter's fallback from stepped_ns, which in an idle
detached session is as old as the last frame: the wait was over before it
began and the \r went out with the paste, which 3.13's REPL then reads as
part of it (4 of 5 sends lost their Enter). The wait now starts from the
host's clock and is checked against now_ns; the REPL's echo of the paste
still sends it sooner, and the wake is scheduled for the deadline. fs.py
sends five times after two idle seconds each in a real pty.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/fs.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -515,6 +515,14 @@ def python_repl_runs_one_line(binary): record = b'MX0 0 0 10 print(6*7)\n' client.rpc(118, struct.pack('<IQI', fid, 0, len(record)) + record) assert wait_for('\n42'), body() + # After the session has sat idle, the Enter still waits for + # the paste: core time is as old as the last frame then. + for n in range(5): + time.sleep(2) + line = f'print({1000 + n})'.encode() + record = b'MX0 0 0 %d %s\n' % (len(line), line) + client.rpc(118, struct.pack('<IQI', fid, 0, len(record)) + record) + assert wait_for(f'\n{1000 + n}'), (n, body()) finally: client.close(fid) |
