mark-s-taylor commented on code in PR #24121:
URL: https://github.com/apache/kafka/pull/24121#discussion_r4585926846
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/InternalTopicManagerTest.java:
##########
@@ -162,7 +164,64 @@ public void
shouldBackOffBetweenRoundsWhenTopicIsMarkedForDeletion() {
TimeoutException.class,
() ->
internalTopicManager.makeReady(Collections.singletonMap(topic1,
internalTopicConfig))
);
- assertEquals(50L, time.milliseconds() - before);
+
+ // The timeout is 50 ms and retry.backoff.ms is 10 ms. The backoff
doubles each round
+ // (10, 20, 40 ms), each with +/- jitter. The deadline is only checked
before a sleep,
+ // so exactly three sleeps happen: after two sleeps the clock is at
most 36 ms (< 50),
+ // and after three it is at least 56 ms (>= 50).
+ final long elapsed = time.milliseconds() - before;
Review Comment:
I agree. I have refactored accordingly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]