-
Notifications
You must be signed in to change notification settings - Fork 130
ci: Enable parallel test execution #4058
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @AbgarSim, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly upgrades the project's testing capabilities by integrating JUnit 5 and enabling parallel test execution. The primary goal is to enhance developer productivity and accelerate feedback loops by allowing tests to run concurrently, thereby reducing the overall test suite execution time. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces parallel test execution for JUnit 5 by adding a junit-platform.properties file. This is a great step towards speeding up the build. My review includes two suggestions to improve the parallel execution configuration. First, I recommend changing the method execution mode to same_thread to prevent potential race conditions in tests that are not thread-safe. Second, I suggest using a dynamic parallelism strategy instead of a fixed one to better adapt to different execution environments. These changes should make the parallel test execution more robust and efficient.
| @@ -0,0 +1,7 @@ | |||
| junit.jupiter.execution.parallel.enabled=true | |||
|
|
|||
| junit.jupiter.execution.parallel.mode.default=concurrent | |||
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.
Setting junit.jupiter.execution.parallel.mode.default to concurrent will execute test methods within the same test class in parallel. This can introduce flakiness and hard-to-debug race conditions if tests share mutable state via instance fields. A safer default is same_thread, which executes methods within a class sequentially but still allows different test classes to run in parallel. Please ensure that tests are designed to be thread-safe at the method level before using concurrent mode.
junit.jupiter.execution.parallel.mode.default=same_thread
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.
So testing locally seems that this same_thread is not helping at all with the speed as opposed to concurrent, also running locally a couple of times I don't see any flake failures. Please advice if we can leave as is and change if there are actually flaky tests due to this @lqiu96
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.
Hmm, I just tried this locally and I think it should be helping:
Without parallel:
[INFO] Reactor Summary for BigQuery Parent 2.57.2-SNAPSHOT:
[INFO]
[INFO] BigQuery Parent .................................... SUCCESS [ 0.762 s]
[INFO] BigQuery ........................................... SUCCESS [02:29 min]
[INFO] Google Cloud BigQuery BOM .......................... SUCCESS [ 0.003 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:31 min
[INFO] Finished at: 2026-01-12T17:22:00-05:00
[INFO] ------------------------------------------------------------------------
Parallel:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for BigQuery Parent 2.57.2-SNAPSHOT:
[INFO]
[INFO] BigQuery Parent .................................... SUCCESS [ 0.695 s]
[INFO] BigQuery ........................................... SUCCESS [ 28.755 s]
[INFO] Google Cloud BigQuery BOM .......................... SUCCESS [ 0.004 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.753 s
[INFO] Finished at: 2026-01-12T17:24:15-05:00
[INFO] ------------------------------------------------------------------------
I think there is quite a big speed up (especially for our GraalVM tests).
google-cloud-bigquery/src/test/resources/junit-platform.properties
Outdated
Show resolved
Hide resolved
google-cloud-bigquery/src/test/resources/junit-platform.properties
Outdated
Show resolved
Hide resolved
google-cloud-bigquery/src/test/resources/junit-platform.properties
Outdated
Show resolved
Hide resolved
|
/gcbrun |
|
@AbgarSim resolved some flaky tests in a separate PR. If you pull the latest changes, the tests should pass now |
52bb2fb to
6f8191d
Compare
Rebased |
6f8191d to
31a0eff
Compare
|
/gcbrun |
|
Seems like we have a flaky test and some quota issue: I'll re-run this in a bit and look to try and disable this test |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #4041
If you write sample code, please follow the samples format.