From 306ab05f1119f63edb30a619b4fa0d3c9c03e763 Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 12 Sep 2024 13:28:54 +0200 Subject: [PATCH 1/2] Set 20s limit to all test runs --- bin/verify-exercises | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/verify-exercises b/bin/verify-exercises index d7632fe2..7d237dd0 100755 --- a/bin/verify-exercises +++ b/bin/verify-exercises @@ -44,6 +44,7 @@ for exercise_path in $exercises; do tmp_dir=$(mktemp -d) trap 'rm -rf $tmp_dir' EXIT INT TERM + trap "$exercise timed out" EXIT KILL # copy the exercise to the temporary directory contents_to_copy=( @@ -71,7 +72,7 @@ for exercise_path in $exercises; do cd "$tmp_dir" - scarb cairo-test --include-ignored + timeout -s SIGKILL 20s scarb cairo-test --include-ignored rm -rf "$tmp_dir" done From 424772a6f93e2353beffd5a239d8757d6185d6d2 Mon Sep 17 00:00:00 2001 From: Nenad Date: Thu, 12 Sep 2024 14:39:56 +0200 Subject: [PATCH 2/2] Print timed out string when timed out --- bin/verify-exercises | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/verify-exercises b/bin/verify-exercises index 7d237dd0..c8b0862b 100755 --- a/bin/verify-exercises +++ b/bin/verify-exercises @@ -44,7 +44,6 @@ for exercise_path in $exercises; do tmp_dir=$(mktemp -d) trap 'rm -rf $tmp_dir' EXIT INT TERM - trap "$exercise timed out" EXIT KILL # copy the exercise to the temporary directory contents_to_copy=( @@ -72,7 +71,7 @@ for exercise_path in $exercises; do cd "$tmp_dir" - timeout -s SIGKILL 20s scarb cairo-test --include-ignored + timeout 20 scarb cairo-test --include-ignored || echo "$exercise timed out" && exit 1 rm -rf "$tmp_dir" done