From c6fa3545cc7b500c0b2b1a754ff7d46abf1d3768 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 11:03:58 -0300 Subject: 9p_io: the parked-write test rests again until the client's release has landed before it reads the body: a write through an open is held (pane.zig batchFor) until the open is let go, and the client lets it go without waiting, so under load the test read the body truncated and the bytes not yet in (it failed on the first run of a loop beside builds, then 30 of 30) Co-Authored-By: Claude Opus 5.5 --- src/9p_io.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/9p_io.zig b/src/9p_io.zig index c3af07d3..377440bd 100644 --- a/src/9p_io.zig +++ b/src/9p_io.zig @@ -1977,6 +1977,14 @@ test "a change waits while the editor is out mid-step, a read does not, and the pardes.turn.wake(); try testing.expect(writer.done.load(.acquire)); if (writer.failure) |err| return err; + // Its bytes are held until its open is let go (pane.zig `batchFor`), and + // the client lets it go without waiting: rested again until that lands, + // the body read only while the editor has the turn. + while (!std.mem.eql(u8, pane.file.?.content, "after\n") and Client.nowMs() < deadline) { + pardes.turn.rest(); + Client.nap(1); + pardes.turn.wake(); + } try testing.expectEqualStrings("after\n", pane.file.?.content); } -- cgit v1.3