Skip to content

[DO-NOT-MERGE] Test parallel mvn T option - #6864

Draft
tkobayas wants to merge 2 commits into
apache:mainfrom
tkobayas:parallel-mvn-T
Draft

[DO-NOT-MERGE] Test parallel mvn T option#6864
tkobayas wants to merge 2 commits into
apache:mainfrom
tkobayas:parallel-mvn-T

Conversation

@tkobayas

@tkobayas tkobayas commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Most of tests run with forkCount = 1. Some intense tests (e.g, test-compiler-integration) run with forkCount = 2.

If we set -T 2 for mvn, we will have separated JVMs from 2 to 4 in parallel for test. They are isolated JVMs, so there should be no concurrency issue like system property.

https://docs.github.com/en/actions/reference/runners/github-hosted-runners?utm_source=chatgpt.com

  • ubuntu-latest runner : 4 cores, 16GB
  • windows-latest runner : 4 cores, 16GB
  • macos-latest runner : 3 cores, 7GB

@tkobayas

tkobayas commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Baseline: Without -T,

  • ubuntu-latest, Java17 : 2h 32m
  • ubuntu-latest, Java21 : 2h 9m

@tkobayas

tkobayas commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

port 8081 conflict. -> should be fixed by random port quarkus.http.test-port=0

2026-08-03T03:51:54.9073583Z [ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 4, Time elapsed: 4.488 s <<< FAILURE! -- in org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepositoryTest
2026-08-03T03:51:54.9076528Z [ERROR] org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepositoryTest.testSaveAndGet -- Time elapsed: 0.008 s <<< ERROR!
2026-08-03T03:51:54.9078549Z java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
2026-08-03T03:51:54.9080152Z    at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:669)
2026-08-03T03:51:54.9082449Z    at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:764)
2026-08-03T03:51:54.9083957Z    at java.base/java.util.Optional.orElseGet(Optional.java:364)
2026-08-03T03:51:54.9085108Z    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2026-08-03T03:51:54.9086400Z    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2026-08-03T03:51:54.9087474Z Caused by: java.lang.RuntimeException: Failed to start quarkus
2026-08-03T03:51:54.9088638Z    at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
...
2026-08-03T03:51:54.9113368Z Caused by: io.quarkus.runtime.QuarkusBindException: Port already bound: 8081: Address already in use
...

@tkobayas tkobayas mentioned this pull request Aug 3, 2026
@yesamer yesamer added the CI label Aug 3, 2026
@tkobayas

tkobayas commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author
  1. OptaPlannerDevUITest — Connection refused: localhost/127.0.0.1:0. The DevUI test uses quarkus.http.test-port for its WebSocket connection, and port 0 breaks it because the DevUI test framework tries to
    literally connect to port 0 instead of the randomly assigned port. This is a known Quarkus DevUI test limitation.

-> We shouldn't fully overwrite with mvn option -Dquarkus.http.test-port=0. Change the approach... -> Set quarkus.http.test-port=0 in parent pom, then any test can overwrite if needed.

  1. Dependency resolution failures — the main problem. Many 999-SNAPSHOT artifacts can't be found:
    - kogito-maven-plugin:999-SNAPSHOT
    - kie-addons-quarkus-flyway-deployment:999-SNAPSHOT
    - jbpm-quarkus-deployment:999-SNAPSHOT
    - kie-addons-quarkus-kubernetes-deployment:999-SNAPSHOT
    - etc.

because a quarkus project has an implicit dependency to -deployment which maven reactor cannot order.

-> Split into 2 phases. 1) install -T 1, 2) test -T 2

@tkobayas

tkobayas commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Hit port 8081 conflict, even though setting -Dquarkus.http.test-port=0.

The issue is reported and fixed for quarkus 3.31.0, so this CI (quarkus 3.27.4.1) is affected.
quarkusio/quarkus#51745

Two-phase build:
- Phase 1: sequential install (-DskipTests) for correct Quarkus -deployment jar ordering
- Phase 2: parallel verify (-T 2) with skip flags to avoid redundant recompilation

Skip flags in verify phase:
- -Dmaven.compiler.skip=true (skip compilation already done in install)
- -Dquarkus.build.skip=true (skip Quarkus augmentation already done in install)
- -Dquarkus.http.test-port=0 (random test ports to avoid collisions)
- -Denforcer.skip=true, -Dcheckstyle.skip=true, -Dformatter.skip=true, -Darchunit.skip=true

Disabled flaky tests under -T 2 resource contention:
- QuarkusEventThreadPoolTest (timing-sensitive queue overflow)
- QuarkusTransactionRollbackTest (transaction status race)
- ProcessDataIndexPostgreSqlIT (Testcontainers timeout)
- VertxJobSchedulerTest.testExactTime (timing-sensitive assertion)
- OptaPlannerDevUITest (DevUI port mismatch with random ports)
- MongoDB integration test module (forked process hang)

Added quarkus.http.test-port=0 to application.properties of modules with
@testprofile to work around Quarkus bug #51745 (port reset on profile restart).

Disabled non-ci workflows with if: false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants