a73x

8119942d

test: the QUIC pump waits for the marker it is about to assert on

a73x   2026-09-03 19:25

Commit message
test: the QUIC pump waits for the marker it is about to assert on

The pump's predicate was "some bytes and some delta have arrived", which
B had already satisfied with its snapshot, so the pump returned at once and
the assertion graded bytes from earlier in the test. Linux's delta happened
to be late enough that it waited anyway; the Mac's was not. The predicate is
the assertion now: B's byte count grew past what it was.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SakwJEwD9dXBoRP5kWbemW

src/server/server_test_quic.zig
Old New
@@ -307,11 +307,22 @@ test "Server: one QUIC client leaving does not disturb the other" {
307 b.drain(); 307 b.drain();
308 var replica = try Engine.init(alloc, .{ .cols = 80, .rows = 24 }); 308 var replica = try Engine.init(alloc, .{ .cols = 80, .rows = 24 });
309 defer replica.deinit(); 309 defer replica.deinit();
310 try quicPump(&td.srv, &both, 15000, &b, struct { 310 // The predicate has to be the ASSERTION, not a weaker relative of it:
311 fn f(t: *quic_server.TestPeer) bool { 311 // `echoed()` counts every byte B has ever taken, and B took a snapshot
312 return t.echoed() > 0 and findFrame(t.cl.in.items, .delta) != null; 312 // long before this marker, so "more than zero, and some delta has
313 // arrived" was already true the moment the pump started. It returned at
314 // once and the assertion below then graded bytes from earlier in the
315 // test. On Linux the delta happened to be late enough that the pump
316 // waited anyway; on the Mac it was not, and the test failed.
317 const Grew = struct {
318 peer: *quic_server.TestPeer,
319 was: usize,
320 fn f(self: *@This()) bool {
321 return self.peer.echoed() > self.was;
313 } 322 }
314 }.f); 323 };
324 var grew: Grew = .{ .peer = &b, .was = before };
325 try quicPump(&td.srv, &both, 15000, &grew, Grew.f);
315 try std.testing.expect(b.echoed() > before); 326 try std.testing.expect(b.echoed() > before);
316 } 327 }
317 328