C0urante opened a new pull request, #15178:
URL: https://github.com/apache/kafka/pull/15178
Currently,
[StartAndStopLatch::await](https://github.com/apache/kafka/blob/6ff21ee1e009a5a2729bb105591a9bfa16c6c4c5/connect/runtime/src/test/java/org/apache/kafka/connect/integration/StartAndStopLatch.java#L96)
returns a boolean that indicates whether the operation completed within the
specified timeout or not. This is similar to the variant of
[CountdownLatch::await](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CountDownLatch.html#await(long,java.util.concurrent.TimeUnit))
with the same signature (i.e., `long timeout, TimeUnit unit`).
However, every single call site for this method either throws an exception
when the return value is false with the intent to fail the test, or should do
so but doesn't (i.e., the rest of the test operates under the assumption that
after `StartAndStopLatch::await` has returned, the operation has completed
successfully). Examples of the latter include
[here](https://github.com/apache/kafka/blob/6ff21ee1e009a5a2729bb105591a9bfa16c6c4c5/connect/runtime/src/test/java/org/apache/kafka/connect/integration/RestExtensionIntegrationTest.java#L107)
and
[here](https://github.com/apache/kafka/blob/6ff21ee1e009a5a2729bb105591a9bfa16c6c4c5/connect/runtime/src/test/java/org/apache/kafka/connect/integration/SessionedProtocolIntegrationTest.java),
and examples of the former include most other invocations of that method.
In order to simplify the API, the contract for the method is altered to have
a `void` return type, and throw a `TimeoutException` if the timeout elapses
before the operation completes, instead of return true/false depending on
whether the operation completed successfully within the timeout.
In addition, some extra granularity is added to the error messages in these
`TimeoutException` instances that may aid in debugging some flaky integration
tests, such as the
`ConnectorRestartApiIntegrationTest::testMultiWorkerRestartOnlyConnector` case
reported in [KAFAK-15675](https://issues.apache.org/jira/browse/KAFKA-15675).
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
--
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: jira-unsubscr...@kafka.apache.org
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org