Skip to content

Commit

Permalink
tests: different setup for ExporterMinTimeToLiveTest
Browse files Browse the repository at this point in the history
  • Loading branch information
VonDerBeck committed Nov 22, 2023
1 parent 721c0ff commit 42cc2ad
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ExporterMinTimeToLiveTest {

@Container
public ZeebeTestContainer zeebeContainer = ZeebeTestContainer
.withCleanupCycleInSeconds(2).doDeleteAfterAcknowledge(true).withMinTTLInSeconds(5);
.withCleanupCycleInSeconds(3).doDeleteAfterAcknowledge(true).withMinTTLInSeconds(10);

private RedisClient redisClient;
private StatefulRedisConnection<String, byte[]> redisConnection;
Expand Down Expand Up @@ -72,14 +72,14 @@ public void shouldConsiderMinTtlWhenDeleteAfterAcknowledge() throws Exception {
};

// when: cleanupHasRun but min TTL has not been reached
Thread.sleep(3000);
Thread.sleep(6000);

// then: cleanup did not yet remove the messages
assertThat(redisConnection.sync().xlen("zeebe:DEPLOYMENT")).isEqualTo(xlen);

// but will delete them after min TTL
var delay = Duration.ofSeconds(3);
await().atMost(Duration.ofSeconds(5)).pollDelay(delay).pollInterval(Duration.ofMillis(500)).pollInSameThread()
var delay = Duration.ofSeconds(5);
await().atMost(Duration.ofSeconds(6)).pollDelay(delay).pollInterval(Duration.ofMillis(1000)).pollInSameThread()
.untilAsserted(() -> assertThat(redisConnection.sync().xlen("zeebe:DEPLOYMENT")).isLessThan(xlen));

}
Expand Down

0 comments on commit 42cc2ad

Please sign in to comment.