Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-9457; Fix flaky test org.apache.kafka.common.network.SelectorTest.testGracefulClose #7989

Merged
merged 1 commit into from Jan 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -584,8 +584,11 @@ public void testGracefulClose() throws Exception {
for (int i = 6; i <= 100 && maxReceiveCountAfterClose < 5; i++) {
int receiveCount = 0;
KafkaChannel channel = createConnectionWithPendingReceives(i);
selector.poll(1000);
assertEquals(1, selector.completedReceives().size()); // wait for first receive
// Poll until one or more receives complete and then close the server-side connection
TestUtils.waitForCondition(() -> {
selector.poll(1000);
return selector.completedReceives().size() > 0;
}, 5000, "Receive not completed");
server.closeConnections();
while (selector.disconnected().isEmpty()) {
selector.poll(1);
Expand Down