From 078185a54baf6093d3f43cd5b51c32322b34af75 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 16 Apr 2026 13:59:40 -0700 Subject: [PATCH] std.Io: still run Condition test on single-threaded this will still work under Evented for example --- lib/std/Io/test.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/std/Io/test.zig b/lib/std/Io/test.zig index 37c6b78c39559e8ad1b279a650a78e848a33e52a..cd40a7782be92755f130f79937a1b4325cf353c8 100644 --- a/lib/std/Io/test.zig +++ b/lib/std/Io/test.zig @@ -973,10 +973,9 @@ test "Select.cancel with no tasks, no deadlock" { } test "Condition" { - if (builtin.single_threaded) return error.SkipZigTest; const io = testing.io; - const TestContext = struct { + const Context = struct { ready: Io.Event = .unset, mutex: Io.Mutex = .init, cond: Io.Condition = .init, @@ -1001,9 +1000,11 @@ test "Condition" { } }; - var ctx: TestContext = .{}; + var ctx: Context = .{}; - var future = try io.concurrent(TestContext.worker, .{&ctx}); + var future = io.concurrent(Context.worker, .{&ctx}) catch |err| switch (err) { + error.ConcurrencyUnavailable => return error.SkipZigTest, + }; defer future.cancel(io) catch {}; try ctx.ready.wait(io); -- 2.54.0