lucasbru opened a new pull request, #24149:
URL: https://github.com/apache/kafka/pull/24149

   `IntegrationTestUtils.DEFAULT_TIMEOUT` is a millisecond value (`60 * 
1000L`), and nearly every user treats it as such (`TimeUnit.MILLISECONDS`, 
`Duration.ofMillis`, `waitForCondition`, deadline arithmetic with 
`currentTimeMillis`). The one exception was 
`startApplicationAndWaitUntilRunning(List<KafkaStreams>)`, which called the 
two-argument overload with `Duration.ofSeconds(DEFAULT_TIMEOUT)`, i.e. a 
timeout of about 16.7 hours instead of 60 seconds. The single-`KafkaStreams` 
overload delegates to it, so both were affected, and tests using them were 
effectively bounded only by their JUnit `@Timeout`.
   
   The bug was introduced by 0601fa0935 (#13141, "fix flaky integrations tests 
by using 60s default timeout for startup"), whose stated intent was a 60 second 
timeout. The constant itself has been in milliseconds since it was added in 
fee6f6f927 (2016, `30 * 1000L`), so its unit is not changed. The fix is at the 
call site, which now uses `Duration.ofMillis`. The constant is renamed to 
`DEFAULT_TIMEOUT_MS` so the unit is visible at every use, and all references in 
`streams/integration-tests` are updated (there were no uses outside that 
module). The unrelated private `DEFAULT_TIMEOUT = 100` in 
`ResetPartitionTimeIntegrationTest`, which is a poll and commit interval, is 
left untouched.
   
   I audited the other time-unit usages in `IntegrationTestUtils`, 
`StreamsTestUtils` and the other callers of the renamed constant 
(`waitForCondition`, `retryOnExceptionWithTimeout`, `getStore`, 
`waitForActiveRestoringTask`, `readResult`, latch and `Thread.sleep` uses, and 
every `Duration.ofSeconds` / `TimeUnit.SECONDS` use in 
`streams/integration-tests` and `streams/src/testFixtures`) and found no 
further mismatches.
   
   Because the no-timeout overloads now really time out after 60 seconds, I ran 
every class touched by the rename plus a sample of the roughly 40 classes 
(about 130 call sites, including `tools`) that call them: 
AtLeastOnceDeliveryMessageLoss, Eos, IQv2EndpointToPartitions, 
KStreamRepartition, NamedTopology, Restore, StateDirectory, StoreQuery, 
StreamTableJoinTopologyOptimization, Suppression, KafkaStreamsCloseOptions, 
KafkaStreamsStaticMember, StreamsUncaughtExceptionHandler, 
TopologyDescriptionPlugin, DeadLetterQueue, InternalTopic, 
SelfManagedOffsetRecovery, QueryableState, TaskMetadata, RegexSource and 
KafkaStreamsTelemetry in `streams:integration-tests`, plus 
`ResetIntegrationTest`, `DescribeStreamsGroupTest` and `ListStreamsGroupTest` 
in `tools`. All 301 streams tests (3 skipped) and 29 tools tests passed with no 
startup timeouts. The slowest individual tests were around 60 seconds in total 
(`QueryableStateIntegrationTest.shouldBeAbleToQueryDuringRebalance`, the Eos 
fencing tes
 ts), which includes far more than startup. Callers outside the sample were not 
run.
   


-- 
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]

Reply via email to