summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-30 11:03:58 -0300
committerGabriel Schneider <[email protected]>2026-10-30 11:03:58 -0300
commitc6fa3545cc7b500c0b2b1a754ff7d46abf1d3768 (patch)
tree9f17dce035e72799389faad98ddf830a87164c11 /src
parent771156f92661e1def2d4deec1465ebca9d4c2a9d (diff)
downloadpardes-c6fa3545cc7b500c0b2b1a754ff7d46abf1d3768.tar.gz
pardes-c6fa3545cc7b500c0b2b1a754ff7d46abf1d3768.zip
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/9p_io.zig8
1 files changed, 8 insertions, 0 deletions
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);
}