authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-06-20 01:04:34-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-20 10:56:23-07:00
log9eb008717b2786e885f4110503dc461d0bf2e682
tree4e0c05df9d5a08c16a6382390e8e546de29129e4
parent51cbb081e947a301bac8aab22c3fb1f93cab63ee

std: prevent random CI failures


1 files changed, 5 insertions(+), 5 deletions(-)

lib/std/Thread/Condition.zig+5-5
......@@ -542,10 +542,10 @@ test "Condition - broadcasting" {
542542 // Wait for all the broadcast threads to spawn.
543543 // timedWait() to detect any potential deadlocks.
544544 while (broadcast_test.count != num_threads) {
545 try broadcast_test.completed.timedWait(
545 broadcast_test.completed.timedWait(
546546 &broadcast_test.mutex,
547547 1 * std.time.ns_per_s,
548 );
548 ) catch {};
549549 }
550550
551551 // Reset the counter and wake all the threads to exit.
......@@ -589,7 +589,7 @@ test "Condition - broadcasting - wake all threads" {
589589 }
590590
591591 while (self.thread_id_to_wake != thread_id) {
592 self.cond.timedWait(&self.mutex, 1 * std.time.ns_per_s) catch std.debug.panic("thread_id {d} timeout {d}", .{ thread_id, self.thread_id_to_wake });
592 self.cond.timedWait(&self.mutex, 1 * std.time.ns_per_s) catch {};
593593 self.wakeups += 1;
594594 }
595595 if (self.thread_id_to_wake <= num_threads) {
......@@ -614,10 +614,10 @@ test "Condition - broadcasting - wake all threads" {
614614 // Wait for all the broadcast threads to spawn.
615615 // timedWait() to detect any potential deadlocks.
616616 while (broadcast_test.count != num_threads) {
617 try broadcast_test.completed.timedWait(
617 broadcast_test.completed.timedWait(
618618 &broadcast_test.mutex,
619619 1 * std.time.ns_per_s,
620 );
620 ) catch {};
621621 }
622622
623623 // Signal thread 1 to wake up