Fix flaky OpenSearchTestBasePluginFuncTest (#20955)#20975
Conversation
PR Reviewer Guide 🔍(Review updated until commit d58a480)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to d58a480
Previous suggestionsSuggestions up to commit 6a6dd43
|
When integTest runs with maxParallelForks > 1, all parallel test JVMs share the same default .gradle-test-kit directory. This causes a race condition in Gradle 9.4 where concurrent tests simultaneously read and write the Groovy DSL compiled script cache (cp_settings), resulting in a NoSuchFileException and UnexpectedBuildFailure. Fix by assigning each test method its own isolated TestKit directory via withTestKitDir() using a subdirectory within the already-unique TemporaryFolder. This eliminates cross-test cache contention while preserving daemon and task history reuse within the same test method (required for UP_TO_DATE assertions). Signed-off-by: Dharmesh <dharmesh.singh@uber.com>
6a6dd43 to
d58a480
Compare
|
Persistent review updated to latest commit d58a480 |
|
❌ Gradle check result for d58a480: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Failed to generate code suggestions for PR |
|
❌ Gradle check result for d3e110b: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20975 +/- ##
============================================
- Coverage 73.31% 73.25% -0.06%
+ Complexity 72544 72526 -18
============================================
Files 5819 5819
Lines 331399 331399
Branches 47887 47887
============================================
- Hits 242955 242768 -187
- Misses 68935 69112 +177
- Partials 19509 19519 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
When integTest runs with maxParallelForks > 1, all parallel test JVMs share the same default .gradle-test-kit directory. This can causes a race condition where concurrent tests simultaneously read and write the Groovy DSL compiled script cache (cp_settings), may result in a NoSuchFileException.
Fixing by assigning each test method its own isolated TestKit directory via withTestKitDir() using a subdirectory within the already-unique temporary folder.
Related Issues
Should resolve #20955
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.