shuke987 opened a new pull request, #65873:
URL: https://github.com/apache/doris/pull/65873
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary:
`CacheFactoryTest.testAsyncLoadingCacheWithExpireAfterWrite` waited a fixed
2.5 seconds for an asynchronous refresh whose loader deliberately sleeps for 2
seconds. Executor scheduling, JVM pauses, or an oversleep of more than the
remaining 500 ms can leave the legal background refresh in flight and make the
counter assertion flaky.
Replace the wall-clock sleep with a bounded Awaitility wait for the existing
`counter == 2` semantic oracle. The assertions that refresh immediately returns
the old cached value and that expiry performs a new load remain unchanged.
### Release note
None
### Check List (For Author)
- Test
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
Validation:
- `./run-fe-ut.sh --run
org.apache.doris.common.CacheFactoryTest#testAsyncLoadingCacheWithExpireAfterWrite`:
passed
- Exact method repeated 10 times: 10/10 passed
- Full `CacheFactoryTest` repeated twice: 2/2 passed, 6 tests per round
- Exact method after rebasing onto the latest `master`: passed
- Behavior changed:
- [x] No.
- [ ] Yes.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]