Skip to content
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][test] Fix flaky test LeaderElectionTest.revalidateLeaderWithinSameSession #22383

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public interface MetadataCache<T> {
*
* @param path
* the path of the object in the metadata store
* @return the cached object or an empty {@link Optional} is the cache doesn't have the object
* @return the cached object or an empty {@link Optional} is the cache does not have the object
*/
Optional<T> getIfCached(String path);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ public static void assertEqualsAndRetry(Supplier<Object> actual,
int retryCount,
long intSleepTimeInMillis) throws Exception {
assertTrue(retryStrategically((__) -> {
if (actual.get().equals(expectedAndRetry)) {
Object actualObject = actual.get();
if (actualObject.equals(expectedAndRetry)) {
return false;
}
assertEquals(actual.get(), expected);
assertEquals(actualObject, expected);
return true;
}, retryCount, intSleepTimeInMillis));
}
Expand Down
Loading