[Tests] Remove retryStrategically from MetadataCacheTest - #14518
Closed
lhotari wants to merge 1 commit into
Closed
Conversation
- the retryStrategically method will always pass on the last retry unless previous retries fail with an exception. This is very confusing. - Awaitility should be used instead of retryStrategically
3 tasks
Member
Author
|
Actually this change doesn't make sense after all. I think that the correct solution would be to revert #14373. |
Member
Author
|
I don't see why this type of code would make sense: assertEquals(objCache.get(key1).join(), Optional.of(value2));
Awaitility.await().untilAsserted(() -> assertEquals(objCache.getIfCached(key1), Optional.of(value2)));This is already the case in #14373. Therefore it should be reverted. |
| assertEquals(objCache.readModifyUpdateOrCreate(key1, __ -> value2).join(), value2); | ||
| assertEquals(objCache.get(key1).join(), Optional.of(value2)); | ||
| assertEqualsAndRetry(() -> objCache.getIfCached(key1), Optional.of(value2), Optional.empty()); | ||
| Awaitility.await().untilAsserted(() -> assertEquals(objCache.getIfCached(key1), Optional.of(value2))); |
Member
There was a problem hiding this comment.
@lhotari
Need ensure objCache.getIfCached(key1) don't return a wrong value.
If we use Awaitility.await().untilAsserted(() -> assertEquals(objCache.getIfCached(key1), Optional.of(value2)));, here has an example case test can't cover.
- objCache.getIfCached(key1) => Optional.of(value1) (We should fail here, but it will continue to run)
- objCache.getIfCached(key1) => Optional.of(value2)
The getIfCached method should always return Optional.empty() or correct value, we don't want to read dirty values from the cache, right?
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
see comments in #14373
the retryStrategically method will always pass on the last retry unless
previous retries fail with an exception. This is very confusing.
Awaitility should be used instead of retryStrategically
Modifications