From 2f2d88e93c6cad46001ba8cf9a4a37785110dba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1stor=20Rodr=C3=ADguez?= Date: Fri, 22 May 2020 12:22:34 +0200 Subject: [PATCH] Forcing the reexecute a flaky test trying to figure out the reason --- .../connect/throttle/AdaptableIntervalThrottlerTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/github/castorm/kafka/connect/throttle/AdaptableIntervalThrottlerTest.java b/src/test/java/com/github/castorm/kafka/connect/throttle/AdaptableIntervalThrottlerTest.java index 955fcbb0..7a109c6f 100644 --- a/src/test/java/com/github/castorm/kafka/connect/throttle/AdaptableIntervalThrottlerTest.java +++ b/src/test/java/com/github/castorm/kafka/connect/throttle/AdaptableIntervalThrottlerTest.java @@ -57,10 +57,10 @@ class AdaptableIntervalThrottlerTest { @BeforeEach void setUp() { - throttler = new AdaptableIntervalThrottler(__ -> config); given(tailThrottler.getIntervalMillis()).willReturn(intervalMillis); given(config.getTailThrottler()).willReturn(tailThrottler); given(config.getCatchupThrottler()).willReturn(catchupThrottler); + throttler = new AdaptableIntervalThrottler(__ -> config); throttler.configure(emptyMap()); } @@ -85,9 +85,11 @@ void givenNewRecordsLastNotLongAgo_whenThrottle_thenTailThrottler() throws Inter @Test void givenNewRecordsLastLongAgo_whenThrottle_thenCatchupThrottler() throws InterruptedException { - throttler.throttle(offset(now.minus(intervalMillis, MILLIS))); + Offset offset = offset(now.minus(intervalMillis, MILLIS)); - then(catchupThrottler).should().throttle(offset(now.minus(intervalMillis, MILLIS))); + throttler.throttle(offset); + + then(catchupThrottler).should().throttle(offset); then(tailThrottler).should(never()).throttle(any()); }