From 1bd2443c93210a8fbeb64ea0d8d68c4a3ea0918f Mon Sep 17 00:00:00 2001 From: Vojtech Horky Date: Wed, 20 Nov 2024 11:54:01 +0100 Subject: [PATCH 1/2] CI: timeout on individual benchmarks with thread dump --- tools/ci/bench-base.sh | 2 +- tools/ci/bench-standalone.sh | 2 +- tools/ci/common.sh | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/ci/bench-base.sh b/tools/ci/bench-base.sh index 9679e41d..5c733657 100755 --- a/tools/ci/bench-base.sh +++ b/tools/ci/bench-base.sh @@ -6,5 +6,5 @@ java -jar "$RENAISSANCE_JAR" --raw-list > list.txt for BENCH in $(cat list.txt); do echo "====> $BENCH" - java -Xms2500M -Xmx2500M -jar "$RENAISSANCE_JAR" -c test -r 1 --csv output.csv --json output.json "$BENCH" || exit 1 + timeout_with_thread_dump 5m java -Xms2500M -Xmx2500M -jar "$RENAISSANCE_JAR" -c test -r 1 --csv output.csv --json output.json "$BENCH" || exit 1 done diff --git a/tools/ci/bench-standalone.sh b/tools/ci/bench-standalone.sh index cee1b26e..1cc8205b 100755 --- a/tools/ci/bench-standalone.sh +++ b/tools/ci/bench-standalone.sh @@ -8,5 +8,5 @@ unzip "$RENAISSANCE_JAR" -d "extracted-renaissance" for BENCH in $(cat list.txt); do echo "====> $BENCH" - java -Xms2500M -Xmx2500M -jar "./extracted-renaissance/single/$BENCH.jar" -c test -r 1 --csv output.csv --json output.json "$BENCH" || exit 1 + timeout_with_thread_dump 5m java -Xms2500M -Xmx2500M -jar "./extracted-renaissance/single/$BENCH.jar" -c test -r 1 --csv output.csv --json output.json "$BENCH" || exit 1 done diff --git a/tools/ci/common.sh b/tools/ci/common.sh index 487656de..a0ab3597 100644 --- a/tools/ci/common.sh +++ b/tools/ci/common.sh @@ -67,6 +67,10 @@ get_jvm_workaround_args() { esac } +timeout_with_thread_dump() { + timeout --signal=3 --kill-after=5s "$@" +} + # Make sure we are in the top-level directory so that we can use # relative paths when referring to files within the project. From 702454d5bca5645551ae86cf65c6df04a6f136e0 Mon Sep 17 00:00:00 2001 From: Vojtech Horky Date: Wed, 20 Nov 2024 12:09:13 +0100 Subject: [PATCH 2/2] CI: timeout not available on Mac --- tools/ci/common.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/ci/common.sh b/tools/ci/common.sh index a0ab3597..d30724e4 100644 --- a/tools/ci/common.sh +++ b/tools/ci/common.sh @@ -67,9 +67,22 @@ get_jvm_workaround_args() { esac } -timeout_with_thread_dump() { +if command -v timeout >/dev/null; then + TIMEOUT_IMPL=timeout_with_thread_dump_real +else + TIMEOUT_IMPL=timeout_with_thread_dump_fake +fi + +timeout_with_thread_dump_real() { timeout --signal=3 --kill-after=5s "$@" } +timeout_with_thread_dump_fake() { + shift + "$@" +} +timeout_with_thread_dump() { + "$TIMEOUT_IMPL" "$@" +} # Make sure we are in the top-level directory so that we can use