Skip to content

Commit

Permalink
merge: #10086
Browse files Browse the repository at this point in the history
10086: Avoid race condition when polling for topology r=oleschoenburg a=npepinpe

## Description

This PR fixes a potential race condition when starting the `EmbeddedBrokerRule`. We poll for the topology and wait until it's complete. Unfortunately, if we're too fast and the request is rejected, the `.join()` will throw, which will be rethrown by `Awaitility` (as when using `untilAsserted` it only catches `AssertionError`), failing the test. By ignoring exceptions here we can focus on just failing when the topology is never complete (Awaitility will print out the last failure in that case).

## Related issues

related to #10084 



Co-authored-by: Nicolas Pepin-Perreault <nicolas.pepin-perreault@camunda.com>
  • Loading branch information
zeebe-bors-camunda[bot] and npepinpe committed Aug 17, 2022
2 parents 52f56d9 + 848cc83 commit b241c19
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ public void startBroker(final PartitionListener... listeners) {
.usePlaintext()
.build()) {
Awaitility.await("until we have a complete topology")
.ignoreExceptions()
.untilAsserted(
() -> {
final var topology = client.newTopologyRequest().send().join();
Expand Down

0 comments on commit b241c19

Please sign in to comment.