ci: abort hung tests with a thread dump and time out a stuck surefire fork (#4940)

* ci: abort hung tests with a thread dump and time out a stuck surefire fork

A hung test ran until the 20-minute job limit killed the shard, leaving no surefire report that named it.

Give every test and lifecycle method a 2-minute JUnit default with a thread dump, set through surefire configurationParameters so quarkus-junit's own junit-platform.properties (its profile-aware class orderer) is not shadowed. In CI, -Dsurefire.timeout=900 kills a fork whose test ignores the interrupt (deadlock, blocking I/O) before the job limit; shards' test steps take 10-11 minutes. SageMakerDockerIntegrationTest waits up to 150 s for real containers, so it gets a 3-minute timeout.

* test: give two Docker-backed tests a timeout that covers their own waits

EksRegistryHostsDockerIntegrationTest (three 60 s cluster-ready waits plus 105 s of polling) and TimestreamInfluxDbDockerIntegrationTest (three 180 s status waits) can legitimately run past the new 2-minute default.

* ci: size the fork timeout to the slowest shard and cover the remaining long tests

surefire.timeout caps a whole shard, and shard 2 already spends 903 s running tests, so 900 s would kill a passing run. Raise it to 1200 s and the job limit to 25 minutes so surefire still reports first. Give the Timestream test headroom beyond its 540 s of status waits, and the opt-in GPU SageMaker test a timeout covering its 300 s poll.
This commit is contained in:
Niels Kootstra authored and GitHub committed 2026-10-10 09:22:05 -05:00
1 parent 8b83892dff
commit 546d7e894e
6 files changed
+32 -4

No files matched your search

+8 -4
View File
@@ -36,10 +36,10 @@ jobs:
test:
name: Build and Test (shard ${{ matrix.shard }})
runs-on: ubuntu-latest
# Shards run 10m49s to 13m47s, so 15 left the slowest about a minute of margin and a slow
# runner spent it. This is a runaway-job kill switch, not a budget: Actions bills the minutes a
# job actually uses, so a higher ceiling costs nothing until something hangs.
timeout-minutes: 20
# Shards now run up to 16m50s (about 15 min of it in "Run tests"), so 20 left little margin.
# This is a runaway-job kill switch, not a budget: Actions bills the minutes a job actually
# uses, so a higher ceiling costs nothing until something hangs.
timeout-minutes: 25
# Drafts skip the suite to spare runners; it runs once the PR is ready for review.
# Written on the job rather than as a gate job so it costs no runner. Pushes to main
# always run; `closed` and `edited` are excluded so widening the trigger types cannot
@@ -115,11 +115,15 @@ jobs:
cmp -s all-classes.txt "$RUNNER_TEMP/compiled-classes.txt" \
|| { echo "::error::test class list from src/test/java differs from target/test-classes:"; diff all-classes.txt "$RUNNER_TEMP/compiled-classes.txt" | head -50; exit 1; }
# surefire.timeout kills a fork whose test ignores JUnit's interrupt (deadlock, blocking
# I/O). It caps the whole shard (one fork runs all its tests), so 20 min leaves room above
# the slowest shard's ~15 min and still lets surefire report before the 25-minute job limit.
- name: Run tests
run: >
./mvnw surefire:test -B
-Dsurefire.includesFile="$GITHUB_WORKSPACE/shard.txt"
-Dsurefire.failIfNoTests=true
-Dsurefire.timeout=1200
# The prefetch runs in the background past its own step, so its per-image
# results are only complete once the tests are done. A pull still running