From 33f62509fc515c767cbef8d329d7666697e54ae7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 22:20:49 -0300 Subject: A Restore logs restored for each pane A script holding serials from before a Restore could not find its panes: the replacement numbers them afresh. The dump now keeps each pane's serial (0 in older dumps), and the replacement's log says `restored ` for each after its `restore `. Co-Authored-By: Claude Opus 5.5 --- test/fs.py | 5 ++++- test/snapshots/dump.golden | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/fs.py b/test/fs.py index 62e78655..67edf01e 100644 --- a/test/fs.py +++ b/test/fs.py @@ -662,7 +662,10 @@ def test(binary, quic=False): 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') + log = restored.read('/log') + assert b'\nrestore ' + str(saved).encode() + b'\n' in log, log + # then which serial each pane had: restored + assert log.endswith(b'\n'.join(b'restored %d %d' % (old, new) for old, new in zip(sorted(old_ids), sorted(int(r.split()[0]) for r in restored.read('/index').splitlines()))) + b'\n'), 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 diff --git a/test/snapshots/dump.golden b/test/snapshots/dump.golden index cdf22daf..deed689c 100644 --- a/test/snapshots/dump.golden +++ b/test/snapshots/dump.golden @@ -33,6 +33,7 @@ .rows = 13, .vweight = 1, .collapsed = false, + .serial = 1, .tag_tail = null, .terminal = .{ .cwd = "/tmp/pardes-snap/dump/cwd", @@ -56,6 +57,7 @@ .rows = 12, .vweight = 1, .collapsed = false, + .serial = 2, .tag_tail = null, .terminal = .{ .cwd = "/tmp/pardes-snap/dump/cwd", @@ -79,6 +81,7 @@ .rows = 27, .vweight = 1, .collapsed = false, + .serial = 3, .tag_tail = null, .terminal = .{ .cwd = "/tmp/pardes-snap/dump/cwd", -- cgit v1.3