Skip to content

Commit 152bd8a

Browse files
committed
[MINOR] Upgrade Surefire to 3.5.2 and harden fork shutdown
- Bump maven-surefire-plugin from 3.0.0 to 3.5.2. - Switch the fork <-> Surefire control channel to TCP via SurefireForkNodeFactory. The default pipe-based channel can deadlock on fork shutdown when child threads are still writing to stdout/err (SUREFIRE-1722), which matches the hang pattern observed in the **.component.c**.** GitHub Actions job: a fork finishes its test class, fails to exit, and the whole job stalls until the 30 minute CI cap. - Add forkedProcessExitTimeoutInSeconds=30 so a fork that still has live non-daemon threads after its test class completes is forcibly killed instead of stalling the run. - Enable enableProcessChecker=native so each fork detects a dead parent and self-terminates, and Surefire can more reliably kill stuck forks on Linux. These changes target the intermittent ~26 minute hangs between test classes seen in the Java component.c CI matrix.
1 parent 88c26e2 commit 152bd8a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<slf4j.version>2.0.11</slf4j.version>
5454
<log4j.version>2.22.1</log4j.version>
5555
<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
56-
<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
56+
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
5757
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
5858
<maven-remote-resources-plugin.version>3.0.0</maven-remote-resources-plugin.version>
5959
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
@@ -410,6 +410,12 @@
410410
<reuseForks>false</reuseForks>
411411
<!-- Kill hung test forks before CI cancels the whole job. -->
412412
<forkedProcessTimeoutInSeconds>${test-forkedProcessTimeout}</forkedProcessTimeoutInSeconds>
413+
<!-- Force-kill forks that still have live threads after the test class completes. -->
414+
<forkedProcessExitTimeoutInSeconds>30</forkedProcessExitTimeoutInSeconds>
415+
<!-- Use TCP instead of pipes for fork control channel (SUREFIRE-1722). -->
416+
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
417+
<!-- Let forks detect a dead parent and self-terminate. -->
418+
<enableProcessChecker>native</enableProcessChecker>
413419
<!-- <reportFormat>brief</reportFormat> -->
414420
<trimStackTrace>true</trimStackTrace>
415421
<rerunFailingTestsCount>${rerun.failing.tests.count}</rerunFailingTestsCount>

0 commit comments

Comments
 (0)