diff options
author | Nicholas Clark <nick@ccl4.org> | 2020-09-16 17:38:17 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2020-09-16 17:38:17 +0000 |
commit | c3788eea4d958f1c7797de83aa454b51176cc9ca (patch) | |
tree | aecc85d502af800d9a15e318b70e23e20386aaea | |
parent | 114a1f36b0fda316047d5b5853e6731ba3192768 (diff) | |
download | perl-c3788eea4d958f1c7797de83aa454b51176cc9ca.tar.gz |
Skip t/porting/bench.t if the cachegrind test takes too long.
On this armv7l system (current Raspberry Pi OS) /usr/bin/valgrind exists,
but if I try to run it it gets stuck in a CPU busy loop somewhere. As was,
this meant that t/porting/bench.t would never complete, causing the test
suite to hang.
As we are already assuming ulimit exists to suppress coredumps, also use it
to set a CPU time limit. This way, the sanity check will time out (and fail)
causing t/porting/bench.t to skip, and the regression tests to pass.
On other systems the generous timeout is harmless, and the test still runs as
intended.
-rw-r--r-- | t/porting/bench.t | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/porting/bench.t b/t/porting/bench.t index 0176b3850c..e79bc29e63 100644 --- a/t/porting/bench.t +++ b/t/porting/bench.t @@ -27,7 +27,8 @@ skip_all "not linux" unless $^O eq 'linux'; skip_all "no valgrind" unless -x '/bin/valgrind' || -x '/usr/bin/valgrind'; # Address sanitizer clashes horribly with cachegrind skip_all "not with ASAN" if $Config{ccflags} =~ /sanitize=address/; -skip_all "cachegrind broken" if system "( ulimit -c 0; valgrind -q --tool=cachegrind --cachegrind-out-file=/dev/null $^X -e0 ) 2>/dev/null"; +# If this takes more than 15 second then something is very wrong +skip_all "cachegrind broken" if system "( ulimit -c 0; ulimit -t 15; valgrind -q --tool=cachegrind --cachegrind-out-file=/dev/null $^X -e0 ) 2>/dev/null"; my $bench_pl = "Porting/bench.pl"; |