summaryrefslogtreecommitdiff
path: root/test/fs.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 12:44:57 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit6fc9f416938b59b665b1fddc052402770a21cc3f (patch)
tree632e83ae787b6e1d231683514663188d3e73e4b9 /test/fs.py
parentc8a3ecc3bcb36f0259f4d8ad2e0cdfcdc3183c9f (diff)
downloadpardes-6fc9f416938b59b665b1fddc052402770a21cc3f.tar.gz
pardes-6fc9f416938b59b665b1fddc052402770a21cc3f.zip
A Restore answers its writer before hanging up, and the log records dumps and restores
A client that wrote Restore saw its connection cut with no answer, and could not tell a Restore from a crash. The listener now lets the writer's answer out before the cut, and cuts only the old editor's connections, refusing their requests meanwhile; a client that dials during it is the new editor's and stays. Dump logs 'dump <path>' and the restored editor's log 'restore <path>'. Keeping connections across a Restore was weighed and left: the fids name the old editor's panes and opens, so it would mean carrying serials and open records into the new one, where acme's Load only adds windows. tty's Restore also closed its shells' ptys without reaping them; it retires them now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/fs.py')
-rw-r--r--test/fs.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/fs.py b/test/fs.py
index b90983d4..b55ad5ab 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -602,23 +602,23 @@ def test(binary, quic=False):
assert old.read_fid(held_screen, count=1) == b'{'
old.write('/pane/1/body', b'changed after dump\n', truncate=True)
# Unsaved text is asked about once, as Exit asks; the second
- # Restore goes ahead.
+ # Restore goes ahead, and is answered before the hang-up.
try:
execute(old, control, 'Restore ' + str(saved))
except OSError as refused:
assert 'Modified' in str(refused), refused
assert old.read('/pane/1/body') == b'changed after dump\n'
- try:
- execute(old, control, 'Restore ' + str(saved))
- except (EOFError, ConnectionResetError, BrokenPipeError):
- pass
+ execute(old, control, 'Restore ' + str(saved))
+ # Refused while the connections are cut, or cut already.
try:
old.read_fid(held_body)
- except (EOFError, ConnectionResetError, BrokenPipeError):
+ except (EOFError, OSError):
pass
else:
raise AssertionError('Restore left an old body fid usable')
with Client(address) as restored:
+ # The new log names its panes, then where they came from.
+ assert restored.read('/log').endswith(b'\nrestore ' + str(saved).encode() + b'\n'), restored.read('/log')
restored_ids = [int(row.split()[0]) for row in restored.read('/index').splitlines()]
assert len(restored_ids) == 2 and old_ids.isdisjoint(restored_ids), restored_ids
file_id, control_id = restored_ids