test(elbv2): avoid a scheduler-dependent timeout assertion (#7944)

Keep the stopped-listener timeout assertion without requiring multiple polls within 350 ms. Dedicated refusal and handshake tests still assert the retry behavior.

Signed-off-by: Andre Kurait <akurait@amazon.com>
This commit is contained in:
Andre Kurait authored and GitHub committed 2026-11-10 18:52:34 -04:00
1 parent 2d8cdeb343
commit 464e32fff4
1 file changed
-3
@@ -44,16 +44,13 @@ class ElbV2TlsReadinessTest {
@Test
void permanentlyStoppedListenerStillTimesOut() throws Exception {
int port = unusedLoopbackPort();
AtomicInteger attempts = new AtomicInteger();
assertThrows(ConditionTimeoutException.class, () -> ElbV2TlsReadiness.await(
Duration.ofMillis(350), () -> {
attempts.incrementAndGet();
try (Socket socket = new Socket()) {
socket.connect(new InetSocketAddress(InetAddress.getLoopbackAddress(), port), 500);
fail("Stopped listener unexpectedly accepted a connection");
}
}));
assertTrue(attempts.get() > 1);
}
@Test