summaryrefslogtreecommitdiff
path: root/core/replica.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 13:19:36 -0300
committerGabriel Schneider <[email protected]>2026-11-20 13:52:38 -0300
commitce92a8c3da84c0bc4f5f2b56acf6e09fa42990f4 (patch)
treee5e6a49724b7f41b088810550e9c55bf93fabdab /core/replica.zig
parent08331643f8c8c2ebcc317b8690c57b5cbb18866e (diff)
downloadpardes-ce92a8c3da84c0bc4f5f2b56acf6e09fa42990f4.tar.gz
pardes-ce92a8c3da84c0bc4f5f2b56acf6e09fa42990f4.zip
join: a join refused for want of a view reloads nothing: openViewInner reloaded every written terminal on every side before Views.open said no (core/Core.zig), a step of a megabyte's snapshot a terminal for nothing a session refuses 550-630 times a soak run; the view now taken first, the reloads after; FIRST the test (core/replica.zig, the earlier one turned round: every view taken, a key of the client's on top, a fifth client refused, the pump's unit, the key confirmed, more output: no reload on any side, the client the session's): on the base expected 2, found 3 (the refused join reloaded); with the change shell-test -Dtest-filter='bytes: a join' 13/13
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/replica.zig')
-rw-r--r--core/replica.zig12
1 files changed, 5 insertions, 7 deletions
diff --git a/core/replica.zig b/core/replica.zig
index e1dc7dc1..ff43203a 100644
--- a/core/replica.zig
+++ b/core/replica.zig
@@ -4616,7 +4616,7 @@ fn firstOnPair(bytes: bool) !void {
try std.testing.expectEqual(reloads + 2, pardes.Term.reloads.n);
}
-test "bytes: a join refused for want of a view reloads every terminal and moves nothing a digest covers: a client with a key on top reloads too, at its place, never taking that unit as moving nothing" {
+test "bytes: a join refused for want of a view reloads nothing on any side: a client with a key on top stays the session's" {
if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const b = try BytesPair.init();
@@ -4630,21 +4630,19 @@ test "bytes: a join refused for want of a view reloads every terminal and moves
for (sent.items) |m| gpa.free(m);
sent.deinit(gpa);
}
- // A key of its own on top; a fifth client refused, its step reloading
- // every terminal in the unit of the pump the others take next; the key
- // confirmed; the program prints on.
+ // A key of its own on top; a fifth client refused, in the unit of the
+ // pump the others take next; the key confirmed; the program prints on.
try key(b.r, 'l', &sent);
try std.testing.expectEqual(@as(usize, 1), b.r.applied);
const before = pardes.Term.reloads.n;
try std.testing.expect(try b.a.join(pardes.views.max + 1, null) == null);
- const session = pardes.Term.reloads.n - before;
- try std.testing.expect(session > 0);
+ try std.testing.expectEqual(before, pardes.Term.reloads.n);
b.a.pump();
b.r.confirm((try b.a.pending()).?);
b.r.confirm(try b.a.take(sent.items[0]));
b.r.settle();
try b.output("and on\r\n");
- try std.testing.expectEqual(2 * session, pardes.Term.reloads.n - before);
+ try std.testing.expectEqual(before, pardes.Term.reloads.n);
try agrees(b.a, b.r);
try sameTerminals(b.a, b.r);
}