This is an automated email from the ASF dual-hosted git repository. rsivaram pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push: new 3a50dc2 KAFKA-8038 - Fix timing issue in SslTransportLayerTest.testCloseSsl (#6377) 3a50dc2 is described below commit 3a50dc27b994ea73228a989b4047b4bd54e31ed7 Author: Rajini Sivaram <rajinisiva...@googlemail.com> AuthorDate: Wed Mar 6 17:33:26 2019 +0000 KAFKA-8038 - Fix timing issue in SslTransportLayerTest.testCloseSsl (#6377) Ensure that server-side channel is ready before it is muted in the test. Reviewers: Ismael Juma <ism...@juma.me.uk> --- .../java/org/apache/kafka/common/network/SslTransportLayerTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java b/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java index 80b24b8..118baec 100644 --- a/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java +++ b/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java @@ -860,6 +860,11 @@ public class SslTransportLayerTest { selector.connect(node, addr, BUFFER_SIZE, BUFFER_SIZE); NetworkTestUtils.waitForChannelReady(selector, node); + // `waitForChannelReady` waits for client-side channel to be ready. This is sufficient for other tests + // operating on the client-side channel. But here, we are muting the server-side channel below, so we + // need to wait for the server-side channel to be ready as well. + TestUtils.waitForCondition(() -> server.selector().channels().stream().allMatch(KafkaChannel::ready), + "Channel not ready"); final ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); server.outputChannel(Channels.newChannel(bytesOut));