diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-25 14:49:19 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-25 14:49:19 -0300 |
| commit | 2e98333b8d4ae7302eb53d7f6b0c667f371adcc5 (patch) | |
| tree | 2a6714480f18a275e3a71671e9d39927233fe013 | |
| parent | d4a712935cdc106b736fa984d176dd7ccbe8a66c (diff) | |
| download | pardes-2e98333b8d4ae7302eb53d7f6b0c667f371adcc5.tar.gz pardes-2e98333b8d4ae7302eb53d7f6b0c667f371adcc5.zip | |
upgrade, test/daemon.py: an Upgrade no build could load says so as an error of no pane, and the upgrade row reads what the walk UI draws (D1, the install gate's failure 2: `--upgrade` from the installed 9bd7dbb00a01 to the release, `the word said` TimeoutError): (a) `Upgrade: now pardes …` is a notice on the notice row until the next message (pick-ui SPEC §10.1), and the test looked for it after its own Undo, whose echo retired it: looked for as soon as the session answers again; the fallback's `Upgrade: the new build could not load this session (…); it goes on as …` shows its start in 80 to 100 columns, cut with `…` (SPEC §10.3; the chip showed a long message's end): the test looks for `could not load this session`, on each client's own screen once a key of its own (made_live's `gg`) has put away its `joined again: …` line (tui.zig noticeLine, drawn over the window's last row, which is the notice row now; replica.zig Link.input), and for `no build could load the session` where it looked for the end; (b) THE FAULT: that refuse-everywhere outcome (`…; its shells are here, and Restore upgrade-N brings the rest back`) was a notice about the fresh session's first pane, which the fresh session's first word's echo (`✓ @p1 Term`) retired at once: the one word of how to get the session back was never on the notice row, only in the history; now an error (until Esc, the next error or SPC e), of no pane as tellEveryView's; TEST FIRST: upgrade.zig "an older build's dump named by a path past 4096 bytes is refused in words and kept for a Restore: an error of no pane, ..." fails on walkui-final at upgrade.zig:640 (the echo leads the row); a user could have hit it at any Upgrade whose new build and the build it ran both refused the dump; core-test filtered `upgrade` 13/14 (1 skipped); test/daemon.py upgrades() from the installed build to Debug: rc 0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
| -rw-r--r-- | runtime/upgrade.zig | 16 | ||||
| -rw-r--r-- | test/daemon.py | 24 |
2 files changed, 29 insertions, 11 deletions
diff --git a/runtime/upgrade.zig b/runtime/upgrade.zig index 7e376da5..ca788cfc 100644 --- a/runtime/upgrade.zig +++ b/runtime/upgrade.zig @@ -476,7 +476,10 @@ pub fn load(gpa: std.mem.Allocator, core_gpa: std.mem.Allocator, opts: pardes.Op var o = opts; o.load_path = null; const p = try pardes.Pardes.init(core_gpa, o); - p.setMessage(.at(p.view().active), std.fmt.bufPrint(&buf, "Upgrade: no build could load the session ({s}); its shells are here, and Restore {s} brings the rest back", .{ why, again_name[0..@min(again_name.len, 400)] }) catch "Upgrade: no build could load the session; its dump is kept for a Restore"); + // An error, of no pane (tellEveryView): a notice would be retired at + // once by the fresh session's first word's echo (its shell's + // `Term`), and its Restore never read on the notice row. + _ = pardes.Messages.say(p, .@"error", pardes.MAX_PANES, std.fmt.bufPrint(&buf, "Upgrade: no build could load the session ({s}); its shells are here, and Restore {s} brings the rest back", .{ why, again_name[0..@min(again_name.len, 400)] }) catch "Upgrade: no build could load the session; its dump is kept for a Restore"); return p; } } @@ -623,7 +626,7 @@ test "an upgrade from the build before reads the dump file its record names, and try std.testing.expectError(error.FileNotFound, tmp.dir.statFile(std.testing.io, "pardes-upgrade-1.dump", .{})); } -test "an older build's dump named by a path past 4096 bytes is refused in words and kept for a Restore" { +test "an older build's dump named by a path past 4096 bytes is refused in words and kept for a Restore: an error of no pane, which the fresh session's first word's echo leaves on the notice row" { const gpa = std.testing.allocator; var text_buf: [4200]u8 = undefined; var long: [4096]u8 = undefined; @@ -633,8 +636,13 @@ test "an older build's dump named by a path past 4096 bytes is refused in words const q = try load(gpa, gpa, .{ .tty_only = true }, &rec); defer q.deinit(); try std.testing.expect(rec.fresh); - const pane = q.panes[q.view().active].?; - try std.testing.expect(std.mem.indexOf(u8, q.messages.saidBy(pane), "Upgrade: no build could load the session") != null); + // The fresh session's first word (its shell's pane, `Term`) announced, + // an echo, as its host does at its start (exec.zig). + _ = pardes.Messages.say(q, .echo, q.view().active, "Term"); + const said = q.messages.headline() orelse return error.NothingSaid; + try std.testing.expect(std.mem.startsWith(u8, said.words(), "Upgrade: no build could load the session")); + try std.testing.expectEqual(pardes.Messages.Kind.@"error", said.kind); + try std.testing.expectEqual(@as(usize, 0), said.src.len); } test "a newer build installed is said on the notice row in its own words, of no pane: the focused file's path is not its cause" { diff --git a/test/daemon.py b/test/daemon.py index d1b64843..3dfb0710 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -4046,6 +4046,10 @@ def upgrades(old, new): client = reconnect(sock) took = time.monotonic() - t assert int(dict(line.split(maxsplit=1) for line in client.read('/status').decode().splitlines())['pid']) == session + # The word said on the notice row (pick-ui SPEC §10.3) until the + # next message: looked for before the test says any (the Undo's + # echo below retires it, §10.1). + wait_for('the word said', lambda: 'Upgrade: now pardes' in screen_text(client)) if procfs: wait_for('the daemon on the new build', lambda: exe_of(daemon) == (str(binary), True)) else: @@ -4111,7 +4115,6 @@ def upgrades(old, new): (stub2.poll() is not None and (b'detached from' in term2.text() or b'upgrade this client too' in term2.text() or b'run the same pardes at both ends' in term2.text())), timeout=30) - wait_for('the word said', lambda: 'Upgrade: now pardes' in screen_text(client)) # Two clients' views kept at the Upgrade, with the time (views.away), # whose clients never come back (the raw replica, the old build's): # each its client's for 30 s, and the session's views all taken. @@ -4171,7 +4174,9 @@ def upgrades(old, new): t0 = time.monotonic() client.write(f'/pane/{shell}/exec', b'Upgrade\n') client.socket.close() - client = saying(sock, 'it goes on as') + # The outcome's words as the notice row shows a long message: + # its start, cut on the right with `…` (pick-ui SPEC §10.3). + client = saying(sock, 'could not load this session') back = time.monotonic() - t0 joined = {} @@ -4186,10 +4191,15 @@ def upgrades(old, new): raise TimeoutError(f'the client joined again: not {[c.stem for _, c in owners if c not in joined]} ' f'{time.monotonic() - t0:.1f} s after the Upgrade, the session back at {back:.1f} s') from None assert again.poll() is None and again5.poll() is None - # The session's news: each client's own screen says it (a long - # message shows its end), not only the view whose input came - # last before the Upgrade's step. - wait_for("each client's own screen saying the Upgrade's outcome", lambda: all(b'it goes on as' in t.text() for t, _ in owners), timeout=15) + # The session's news: each client's own screen says it, not only + # the view whose input came last before the Upgrade's step: on + # its notice row (pick-ui SPEC §10.3; a long message shows its + # start), once a key of its own has put away the client's own + # word drawn over that row (`joined again: ...`, tui.zig + # noticeLine; replica.zig Link.input). + for t, check in owners: + made_live(t, check) + wait_for("each client's own screen saying the Upgrade's outcome", lambda: all(b'could not load this session' in t.text() for t, _ in owners), timeout=15) for (t, check), pane, theirs in zip(owners, mine, reversed(mine)): in_own_view('its own view again', lambda: made_live(t, check), client, pane, theirs) for c, t in ((again, term4), (again5, term5)): @@ -4208,7 +4218,7 @@ def upgrades(old, new): refusing('all') client.write(f'/pane/{shell}/exec', b'Upgrade\n') client.socket.close() - client = saying(sock, 'brings the rest back') + client = saying(sock, 'no build could load the session') # The dump stays in the state file, under its label (a second # upgrade of one pid is `upgrade-<pid>-2`). kept = client.read('/dumps').decode() |
