-
-
Notifications
You must be signed in to change notification settings - Fork 188
[ci] Add surefire fork timeouts to prevent CI hangs #6186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ jobs: | |
| distribution: liberica | ||
| java-version: ${{ env.DEV_JDK }} | ||
| - uses: ./.github/actions/maven-cache | ||
| - run: mvn -V -B --no-transfer-progress license:check | ||
| - run: mvn -V -B --no-transfer-progress --offline license:check | ||
| timeout-minutes: 10 | ||
| dependencies: | ||
| name: Dependency checks | ||
|
|
@@ -88,14 +88,19 @@ jobs: | |
| timeout-minutes: 30 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| MAVEN_OPTS: >- | ||
| -DtrimStackTrace=false | ||
| -D'maven.resolver.transport=wagon' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want wagon at all? Its no longer the default https://maven.apache.org/guides/mini/guide-resolver-transport.html for a reason
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [This response was co-authored with Claude Code. -Joe] Good question, and the git history has an answer: I'd like to try removing it (and the wagon-specific timeout flags) and replacing with Aether native timeout flags ( |
||
| -D'maven.wagon.http.connectionTimeout=10000' | ||
| -D'maven.wagon.http.readTimeout=30000' | ||
| run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B --no-transfer-progress -T 1C compile test-compile -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip' --projects '!exist-installer' | ||
| - name: Maven Unit Tests | ||
| if: matrix.test-type == 'unit' | ||
| timeout-minutes: 45 | ||
| run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B --no-transfer-progress test -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip' -D'mvnd.maxLostKeepAlive=6000' | ||
| - name: Maven Integration Tests | ||
| if: matrix.test-type == 'integration' | ||
| timeout-minutes: 45 | ||
| timeout-minutes: 30 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've seen 37min successful runs on CI. I would suggest to be more generous with the CI timeout until we can establish a new baseline of successful CI runs, and then lower the workflow timeouts accordingly.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [This response was co-authored with Claude Code. -Joe] Good to know — reverting to 45 minutes. The 30-minute reduction was premature given you've seen legitimate 37-minute runs. |
||
| run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B --no-transfer-progress verify -DskipUnitTests=true -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip' -D'mvnd.maxLostKeepAlive=6000' | ||
| - name: Javadoc (ubuntu unit only) | ||
| if: matrix.os == 'ubuntu-latest' && matrix.test-type == 'unit' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -842,6 +842,10 @@ | |
| However it can make it hard to diagnose problems if tests leak state; If you experience | ||
| such a problem you may want to set it to `false` whilst debugging --> | ||
| <reuseForks>true</reuseForks> | ||
| <!-- Kill forked JVMs that hang (e.g. DeadlockIT, MoveResourceTest). | ||
| 10 minutes is generous; clean runs complete in ~3.5 minutes. --> | ||
| <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea with #6045 was to move slow tests into the IT phase. Unit test should be faster, so I would expect the timeouts here to be lower compared to failsafe tests. If there are slow tests left in surefire, I would rather move them to IT.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [This response was co-authored with Claude Code. -Joe] Surefire does fork here — |
||
| <forkedProcessExitTimeoutInSeconds>60</forkedProcessExitTimeoutInSeconds> | ||
| <argLine>@{jacocoArgLine} --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.ref=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED -Dfile.encoding=${project.build.sourceEncoding}</argLine> | ||
| <systemPropertyVariables> | ||
| <user.country>UK</user.country> | ||
|
|
@@ -863,6 +867,10 @@ | |
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-failsafe-plugin</artifactId> | ||
| <version>3.5.5</version> | ||
| <configuration> | ||
| <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds> | ||
| <forkedProcessExitTimeoutInSeconds>60</forkedProcessExitTimeoutInSeconds> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like centralising these options, but we are doing it only half-heartedly e.g.
-DtrimStackTrace=falseis appears in the env and on every invocation. We should make this DRY. There are more flags similarly repeatedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[This response was co-authored with Claude Code. -Joe]
Agreed — this is a real smell and worth cleaning up properly. I'll address this as part of reworking the transport question; once we settle on native vs wagon the flag set will change anyway, and that's a good moment to centralize everything.