Skip to content

Commit 7fd4064

Browse files
committed
fix(ci): tighten Node watchdog validation
1 parent 95fa269 commit 7fd4064

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

scripts/ci/run-node-checks.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ run_node_tests() {
4646
node_test_args+=(--test-reporter=spec)
4747
fi
4848

49-
case "$NODE_TEST_TIMEOUT_SECONDS:$NODE_TEST_KILL_AFTER_SECONDS" in
50-
*[!0-9:]*|0:*|*:0)
51-
echo "NODE_TEST_TIMEOUT_SECONDS and NODE_TEST_KILL_AFTER_SECONDS must be positive integers" >&2
49+
case "$NODE_TEST_TIMEOUT_SECONDS" in
50+
*[!0-9]*|0)
51+
echo "NODE_TEST_TIMEOUT_SECONDS must be a positive integer" >&2
52+
return 2
53+
;;
54+
esac
55+
case "$NODE_TEST_KILL_AFTER_SECONDS" in
56+
*[!0-9]*|0)
57+
echo "NODE_TEST_KILL_AFTER_SECONDS must be a positive integer" >&2
5258
return 2
5359
;;
5460
esac
@@ -73,7 +79,7 @@ run_node_tests() {
7379
fi
7480

7581
if [ "$status" -eq 124 ] || [ "$status" -eq 137 ]; then
76-
echo "Node test suite exceeded ${NODE_TEST_TIMEOUT_SECONDS}s; terminated to prevent a hung CI job" >&2
82+
echo "Node test suite exited with status $status under the ${NODE_TEST_TIMEOUT_SECONDS}s watchdog; inspect the preceding output for a timeout or signal" >&2
7783
fi
7884
return "$status"
7985
}

0 commit comments

Comments
 (0)