-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix flakey test testOverflowDisabledAsynchronous #18891
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
Fix flakey test testOverflowDisabledAsynchronous #18891
Conversation
|
❌ Gradle check result for ff212d3: 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? |
Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
ff212d3 to
3a0dc16
Compare
|
❌ Gradle check result for 3a0dc16: 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? |
Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
|
❌ Gradle check result for a7f6100: 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? |
|
Thanks @guojialiang92. It looks like there's a similar problem here: OpenSearch/server/src/test/java/org/opensearch/index/store/remote/utils/TransferManagerTestCase.java Lines 322 to 325 in 36844f5
That fixed sleep is bad and does not guarantee the async operation completes |
Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
Yes, you are right. We should avoid calls like |
server/src/test/java/org/opensearch/index/store/remote/utils/TransferManagerTestCase.java
Outdated
Show resolved
Hide resolved
|
@guojialiang92 The other option here is to revert commit 36844f5 until the author can come back and properly fix these test cases. It was only committed a few days ago and should revert cleanly. What do you think? |
Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
I changed the return type of |
server/src/test/java/org/opensearch/index/store/remote/utils/TransferManagerTestCase.java
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18891 +/- ##
============================================
- Coverage 72.77% 72.77% -0.01%
- Complexity 68690 68724 +34
============================================
Files 5582 5587 +5
Lines 315456 315716 +260
Branches 45778 45817 +39
============================================
+ Hits 229568 229749 +181
- Misses 67290 67358 +68
- Partials 18598 18609 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
…18891) Signed-off-by: guojialiang <guojialiang.2012@bytedance.com> Signed-off-by: sunqijun.jun <sunqijun.jun@bytedance.com>
…18891) Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
…18891) Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
Description
I found this flakey test in #18890's gradle test.
I investigated the cause and fixed it.
Reproduce
The issue can be reproduced by running the following command, and it occurs approximately once every
3000runs.Analysis
The reason is that
TransferManager#fetchBlobAsyncis an asynchronous operation, and ifTransferManager#fetchBlobAsynccompletes before theassertNotNull, problem will be reproduced.If a
Thread.sleep(1000)is added before theassertNotNull, this issue can be reproduced stably.In summary we should remove
assertNotNull.Solution
After discussing with @andrross , we made the following modifications:
Thread.sleepin the test, we modified the return value type ofTransferManager#fetchBlobAsynctoCompletableFuture<IndexInput>.TransferManagerTestCase#asyncFetchBlobWithName.Meanwhile, we would like to invite the author (@ajaymovva) to take a look and see if the above understanding is correct.
Related Issues
Resolves #[18850]
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.