Skip to content

Commit

Permalink
merge: #9585
Browse files Browse the repository at this point in the history
9585: [Backport stable/8.0] Set higher timeout for awaitility in ControlledActorClockEndpointIT r=Zelldon a=backport-action

# Description
Backport of #9579 to `stable/8.0`.

relates to #9499

Co-authored-by: Christopher Zell <[email protected]>
  • Loading branch information
zeebe-bors-camunda[bot] and ChrisKujawa authored Jun 23, 2022
2 parents 81f19d9 + a2da47d commit fcac5b5
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ private List<Record<?>> searchExportedRecords() throws IOException, InterruptedE
.collect(Collectors.toList());
}

private int getExportedRecordsCount() throws IOException, InterruptedException {
return searchExportedRecords().size();
}

void startElasticsearch() {
final var version = RestClient.class.getPackage().getImplementationVersion();
elasticsearchContainer =
Expand Down Expand Up @@ -176,12 +180,12 @@ private void waitForExportedRecords() {
final AtomicInteger previouslySeenRecords = new AtomicInteger(1);
Awaitility.await("Waiting for a stable number of exported records")
.during(Duration.ofSeconds(5))
.timeout(Duration.ofSeconds(30))
.until(
this::searchExportedRecords,
(records) -> {
final var now = records.size();
final var previous = previouslySeenRecords.getAndSet(now);
return now == previous;
this::getExportedRecordsCount,
(recordCount) -> {
final var previous = previouslySeenRecords.getAndSet(recordCount);
return recordCount == previous;
});
}

Expand Down

0 comments on commit fcac5b5

Please sign in to comment.