-
Bug
-
Resolution: Fixed
-
P4
-
18
-
master
The test/langtools/jdk/jshell/JdiHangingListenExecutionControlTest.java test has failed intermittently with the following exception:
test JdiHangingListenExecutionControlTest.hangListenTimeoutTest(): failure [8015ms]
java.lang.AssertionError: Launching JShell execution engine threw: Failed remote listen: java.util.concurrent.ExecutionException: com.sun.jdi.connect.TransportTimeoutException: timeout waiting for connection @ com.sun.jdi.SocketListen (defaults: timeout=, port=, localAddress=) -- {timeout=timeout=8000, port=port=12345, localAddress=localAddress=} expected [true] but found [false]
at org.testng.Assert.fail(Assert.java:99)
at org.testng.Assert.failNotEquals(Assert.java:1037)
at org.testng.Assert.assertTrue(Assert.java:45)
at JdiHangingListenExecutionControlTest.hangListenTimeoutTest(JdiHangingListenExecutionControlTest.java:49)
The test verifies the exception message in an IllegalStateException that gets thrown and if that exception message doesn't match the expectation then it fails the test:
try {
System.err.printf("Unexpected return value: %s\n",
HangingRemoteAgent.state(false, null).eval("33;"));
} catch (IllegalStateException ex) {
assertTrue(ex.getMessage().startsWith(EXPECTED_ERROR), ex.getMessage());
return;
}
In its current form, we lose the useful information in the IllegalStateException and thus it's hard to understand why the test failed. It would be better to rethrow the original exception if the exception message doesn't meet the expectations.
test JdiHangingListenExecutionControlTest.hangListenTimeoutTest(): failure [8015ms]
java.lang.AssertionError: Launching JShell execution engine threw: Failed remote listen: java.util.concurrent.ExecutionException: com.sun.jdi.connect.TransportTimeoutException: timeout waiting for connection @ com.sun.jdi.SocketListen (defaults: timeout=, port=, localAddress=) -- {timeout=timeout=8000, port=port=12345, localAddress=localAddress=} expected [true] but found [false]
at org.testng.Assert.fail(Assert.java:99)
at org.testng.Assert.failNotEquals(Assert.java:1037)
at org.testng.Assert.assertTrue(Assert.java:45)
at JdiHangingListenExecutionControlTest.hangListenTimeoutTest(JdiHangingListenExecutionControlTest.java:49)
The test verifies the exception message in an IllegalStateException that gets thrown and if that exception message doesn't match the expectation then it fails the test:
try {
System.err.printf("Unexpected return value: %s\n",
HangingRemoteAgent.state(false, null).eval("33;"));
} catch (IllegalStateException ex) {
assertTrue(ex.getMessage().startsWith(EXPECTED_ERROR), ex.getMessage());
return;
}
In its current form, we lose the useful information in the IllegalStateException and thus it's hard to understand why the test failed. It would be better to rethrow the original exception if the exception message doesn't meet the expectations.
- links to
-
Commit(master) openjdk/jdk/4412c079
-
Review(master) openjdk/jdk/23978