Skip to content

Commit f976811

Browse files
committed
dist/threads/t/libc.t: Add timer to avoid deadlock
This test file can deadlock if there are bugs. Add a timeout to keep the test from hanging indefinitely.
1 parent a83cff2 commit f976811

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dist/threads/t/libc.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ BEGIN {
99
skip_all(q/Perl not compiled with 'useithreads'/);
1010
}
1111

12+
my $time_out_factor = $ENV{PERL_TEST_TIME_OUT_FACTOR} || 1;
13+
$time_out_factor = 1 if $time_out_factor < 1;
14+
15+
# Guard against bugs that result in deadlock
16+
watchdog(1 * 60 * $time_out_factor);
17+
1218
plan(11);
1319
}
1420

0 commit comments

Comments
 (0)