Skip to content

Commit 4a7a83a

Browse files
author
duke
committed
Backport 4412c079fccefbb235b22651206089f5bac47d18
1 parent 186c4f0 commit 4a7a83a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/langtools/jdk/jshell/JdiHangingListenExecutionControlTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,11 @@ public void hangListenTimeoutTest() {
4646
System.err.printf("Unexpected return value: %s\n",
4747
HangingRemoteAgent.state(false, null).eval("33;"));
4848
} catch (IllegalStateException ex) {
49-
assertTrue(ex.getMessage().startsWith(EXPECTED_ERROR), ex.getMessage());
49+
if (!ex.getMessage().startsWith(EXPECTED_ERROR)) {
50+
// unexpected message in the exception, rethrow the original exception
51+
throw ex;
52+
}
53+
// received expected exception
5054
return;
5155
}
5256
fail("Expected IllegalStateException");

0 commit comments

Comments
 (0)