Skip to content

Commit

Permalink
[fix][test] Fix flaky test LeaderElectionTest.revalidateLeaderWithinS…
Browse files Browse the repository at this point in the history
…ameSession (#22383)

(cherry picked from commit 216b830)
  • Loading branch information
nikam14 authored and lhotari committed Sep 23, 2024
1 parent a17a262 commit e63dcd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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 @@ -119,10 +119,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

0 comments on commit e63dcd4

Please sign in to comment.