From f5235228de682a5c9c3f19376981f4eb8b93fe1d Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Mon, 16 Nov 2026 11:16:07 +0000 Subject: [PATCH] test(proc): cut the stopGroup race test to 50 iterations Without the kill fix it came with, the test fails within its first three iterations in every run: the first or second natively, and the second or third under QEMU, where the first is slow while QEMU translates the code. At 50 it still fails without the fix in 3 of 3 runs, under QEMU and natively, and with it the test takes half as long: about 0.65 s instead of 1.4 s under QEMU, and 0.05 to 0.1 s instead of 0.1 to 0.2 s natively. --- changelog.d/+stopgroup-test-iters.misc.md | 1 + src/proc_test.zig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/+stopgroup-test-iters.misc.md diff --git a/changelog.d/+stopgroup-test-iters.misc.md b/changelog.d/+stopgroup-test-iters.misc.md new file mode 100644 index 0000000..ed06c77 --- /dev/null +++ b/changelog.d/+stopgroup-test-iters.misc.md @@ -0,0 +1 @@ +The test that `proc.stopGroup` kills a child whose pgid was only just published runs 50 times instead of 100: without the kill fix it fails within its first three runs either way, and it takes half as long. diff --git a/src/proc_test.zig b/src/proc_test.zig index 8200c39..349a763 100644 --- a/src/proc_test.zig +++ b/src/proc_test.zig @@ -361,7 +361,7 @@ test "stopGroup on a pgid as soon as it is published kills the child" { try linux.sched_setaffinity(0, &one); } defer if (pinned) linux.sched_setaffinity(0, &cpus) catch {}; - for (0..100) |i| { + for (0..50) |i| { stop_pgid.store(0, .seq_cst); const name = A.print("background{d}", .{i}) catch unreachable; const script = A.print("sleep 30 >/dev/null &\necho $! > {s}\nsleep 2\n", .{name}) catch unreachable;