This commit is contained in:
Anshul Bisht 2025-10-07 23:22:10 +00:00 committed by GitHub
commit bd9faaeb04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 2 deletions

View File

@ -36,6 +36,7 @@ import java.util.stream.Collectors;
import static java.util.Arrays.asList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class Tls13SelectorTest extends SslSelectorTest {
@ -47,11 +48,27 @@ public class Tls13SelectorTest extends SslSelectorTest {
return configs;
}
@Flaky(value = "KAFKA-14249", comment = "Copied from base class. Remove this override once the flakiness has been resolved.")
@Flaky(value = "KAFKA-14249", comment = "Stabilize TLSv1.3 idle expiry by waiting for READY and allowing a short observe window.")
@Test
@Override
public void testCloseOldestConnection() throws Exception {
super.testCloseOldestConnection();
String id = "0";
selector.connect(id, new InetSocketAddress("localhost", server.port), BUFFER_SIZE, BUFFER_SIZE);
NetworkTestUtils.waitForChannelReady(selector, id);
selector.poll(50);
time.sleep(10_000L);
TestUtils.waitForCondition(() -> {
try {
selector.poll(50);
} catch (IOException e) {
throw new RuntimeException(e);
}
ChannelState state = selector.disconnected().get(id);
return state == ChannelState.EXPIRED;
}, 30_000L, "Expected idle connection to expire");
assertTrue(selector.disconnected().containsKey(id), "The idle connection should have been closed");
assertEquals(ChannelState.EXPIRED, selector.disconnected().get(id));
}
/**