Skip to content

Commit

Permalink
Fix flakiness of BrokerRegistryIntegrationTest
Browse files Browse the repository at this point in the history
  • Loading branch information
BewareMyPower committed Sep 27, 2024
1 parent a220390 commit ef0a8eb
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ public void testRegisterAgain() throws Exception {
final var oldResult = metadataStore.get(brokerMetadataPath).get().orElseThrow();
log.info("Old result: {} {}", new String(oldResult.getValue()), oldResult.getStat().getVersion());
brokerRegistry.registerAsync().get();
final var newResult = metadataStore.get(brokerMetadataPath).get().orElseThrow();
log.info("New result: {} {}", new String(newResult.getValue()), newResult.getStat().getVersion());
Assert.assertTrue(newResult.getStat().getVersion() > oldResult.getStat().getVersion());
Assert.assertEquals(newResult.getValue(), oldResult.getValue());

Awaitility.await().atMost(Duration.ofSeconds(3)).untilAsserted(() -> {
final var newResult = metadataStore.get(brokerMetadataPath).get().orElseThrow();
log.info("New result: {} {}", new String(newResult.getValue()), newResult.getStat().getVersion());
Assert.assertTrue(newResult.getStat().getVersion() > oldResult.getStat().getVersion());
Assert.assertEquals(newResult.getValue(), oldResult.getValue());
});
}

private ServiceConfiguration brokerConfig() {
Expand Down

0 comments on commit ef0a8eb

Please sign in to comment.