From 2b55b41752a0e31685086bdeeafa53db8d6af32b Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Tue, 27 Jan 2026 13:01:15 +0530 Subject: [PATCH] fix assumption in test --- .../channels/Selector/ConnectionRefusedMessage.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/jdk/java/nio/channels/Selector/ConnectionRefusedMessage.java b/test/jdk/java/nio/channels/Selector/ConnectionRefusedMessage.java index 2a749c78fce..f59740f6347 100644 --- a/test/jdk/java/nio/channels/Selector/ConnectionRefusedMessage.java +++ b/test/jdk/java/nio/channels/Selector/ConnectionRefusedMessage.java @@ -83,11 +83,11 @@ class ConnectionRefusedMessage { readyKey.cancel(); try { boolean success = sc.finishConnect(); - if (success) { - // this test checks the exception message of a ConnectException, so it's - // OK to skip the test if something unexpectedly accepted the connection - assumeTrue(success, "unexpectedly connected to " + destAddr); - } + // this test checks the exception message of a ConnectException, so it's + // OK to skip the test if something unexpectedly accepted the connection + assumeFalse(success, "unexpectedly connected to " + destAddr); + // this test doesn't expect finishConnect() to return normally + // with a return value of false fail("ConnectException was not thrown"); } catch (ConnectException ce) { System.err.println("got (expected) ConnectException - " + ce);