Skip to content
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

Make the maven build task compatible with parallel builds #17484

Merged
merged 1 commit into from
May 28, 2021

Conversation

essobedo
Copy link
Contributor

@essobedo essobedo commented May 26, 2021

fixes #16932

Motivation

So far, due to the fact that System properties can be set by the build task of the maven plugin, we could end up with build conflicts when used in parallel mode. The goal of this enhancement is to ensure that we can use parallel builds without getting conflicts.

Modifications

  • Relies on the runtime default profile to isolate the value of the build profile since the class ProfileManager is loaded with different QuarkusClassLoaders
  • Sets the runtime default profile using the value set in the properties of the plugin
  • Prints a warning if the parallel build is enabled and system properties are used
  • Adds the ability to launch a build of an integration test with parallel mode enabled
  • Adds an integration test for it

@quarkus-bot quarkus-bot bot added area/config area/core area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven area/testing labels May 26, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented May 26, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 95beb0a

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Build ⚠️ Check → Logs Raw logs

@essobedo essobedo force-pushed the maven-build-thread-safe branch 2 times, most recently from b015f29 to 7f5079a Compare May 26, 2021 19:45
@quarkus-bot
Copy link

quarkus-bot bot commented May 26, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building b015f29

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Devtools Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 16 Build ⚠️ Check → Logs Raw logs
Maven Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Maven Tests - JDK 11 Windows Build Test failures Logs Raw logs
MicroProfile TCKs Tests Verify ⚠️ Check → Logs Raw logs
Native Tests - Amazon Build ⚠️ Check → Logs Raw logs
Native Tests - Cache ⚠️ Check → Logs Raw logs
Native Tests - Data1 Build ⚠️ Check → Logs Raw logs
Native Tests - Data2 Build ⚠️ Check → Logs Raw logs
Native Tests - Data3 Build ⚠️ Check → Logs Raw logs
Native Tests - Data4 Build ⚠️ Check → Logs Raw logs
Native Tests - Data5 Build ⚠️ Check → Logs Raw logs
Native Tests - Data6 Build ⚠️ Check → Logs Raw logs
Native Tests - Data7 Build ⚠️ Check → Logs Raw logs
Native Tests - HTTP ⚠️ Check → Logs Raw logs
Native Tests - Main Build ⚠️ Check → Logs Raw logs
Native Tests - Messaging1 Build ⚠️ Check → Logs Raw logs
Native Tests - Messaging2 Reclaim Disk Space ⚠️ Check → Logs Raw logs
Native Tests - Misc1 ⚠️ Check → Logs Raw logs
Native Tests - Misc2 ⚠️ Check → Logs Raw logs
Native Tests - Misc3 ⚠️ Check → Logs Raw logs
Native Tests - Misc4 ⚠️ Check → Logs Raw logs
Native Tests - Security1 Build ⚠️ Check → Logs Raw logs
Native Tests - Security2 Build ⚠️ Check → Logs Raw logs
Native Tests - Security3 Build ⚠️ Check → Logs Raw logs
Native Tests - Spring ⚠️ Check → Logs Raw logs
Native Tests - Windows - hibernate-validator ⚠️ Check → Logs Raw logs
Native Tests - gRPC ⚠️ Check → Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ Maven Tests - JDK 11 Windows #

📦 integration-tests/maven

io.quarkus.maven.it.BuildIT.testModuleWithOverriddenBuildProfile line 98 - More details - Source on GitHub

@quarkus-bot
Copy link

quarkus-bot bot commented May 26, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 7f5079a

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Build ⚠️ Check → Logs Raw logs

@quarkus-bot
Copy link

quarkus-bot bot commented May 27, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 4f6dc1d

Status Name Step Test failures Logs Raw logs
JVM Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
✔️ JVM Tests - JDK 16
Maven Tests - JDK 11 Build Test failures Logs Raw logs
Maven Tests - JDK 11 Windows Build Test failures Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ Maven Tests - JDK 11 #

📦 integration-tests/maven

io.quarkus.maven.it.BuildIT.testModuleWithOverriddenBuildProfile line 98 - More details - Source on GitHub


⚙️ Maven Tests - JDK 11 Windows #

📦 integration-tests/maven

io.quarkus.maven.it.BuildIT.testModuleWithOverriddenBuildProfile line 98 - More details - Source on GitHub

Comment on lines -59 to -60
case TEST:
return TEST;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed as it is actually dead code

@essobedo
Copy link
Contributor Author

@aloubyansky @famod Hi, WDYT of this PR? It is the best compromise I could find as it does the job and it doesn't brake anything. To be honest, I'm not really fan of relying on the runtime default profile, I would rather prefer having a specific static field for that but if I do so I break the test io.quarkus.maven.it.BuildIT.testModuleWithOverriddenBuildProfile

Copy link
Member

@aloubyansky aloubyansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @essobedo Thanks!

@quarkus-bot
Copy link

quarkus-bot bot commented May 28, 2021

Failing Jobs - Building c44cdc8

Status Name Step Test failures Logs Raw logs
Native Tests - Misc4 Build ⚠️ Check → Logs Raw logs

@essobedo
Copy link
Contributor Author

FYI I don't believe that this PR is the root cause of the build failure since it is an IT of Gradle in native mode and this PR doesn't affect the Gradle related code.

@essobedo
Copy link
Contributor Author

@aloubyansky Could you please relaunch the build if needed?

@aloubyansky aloubyansky merged commit 966f3c3 into quarkusio:main May 28, 2021
@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone May 28, 2021
@famod
Copy link
Member

famod commented May 28, 2021

@aloubyansky WDYT about backporting (to 2.0)?

@essobedo essobedo deleted the maven-build-thread-safe branch May 28, 2021 15:33
@essobedo
Copy link
Contributor Author

essobedo commented May 28, 2021

@aloubyansky WDYT about backporting (to 2.0)?

Let me know if you want a back port, I can provide it.

@essobedo
Copy link
Contributor Author

BTW I did not forget to provide some doc about what has been done at maven plugin level, it will be my next contribution. I need to finish something else first

@famod
Copy link
Member

famod commented May 28, 2021

Let me know if you want a back port, I can provide it.

Currently, this would merge just fine to the 2.0 branch. But thanks for your offer!

BTW what is the target version of the main now ? 2.1 ?

Yes, see the milestone assignment (top right).

@gsmet gsmet modified the milestones: 2.1 - main, 2.0.0.Final May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config area/core area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven area/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the maven build task compatible with parallel builds
4 participants