RFR: 8284993: Replace System.exit call in swing tests with RuntimeException [v2]
Alexander Zvegintsev
azvegint at openjdk.java.net
Wed Apr 20 10:07:28 UTC 2022
On Wed, 20 Apr 2022 09:17:31 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> test/jdk/javax/swing/JComboBox/8019180/Test8019180.java line 66:
>>
>>> 64: }
>>> 65: SwingUtilities.getWindowAncestor(this.test).dispose();
>>> 66: LATCH.countDown();
>>
>> Looks like that before the fix all tests had graceful shutdown in standalone mode.
>>
>> Now there are hanging open windows when they fails.
>> e.g. those two lines could be wrapped in `finally` block for graceful test finish.
>
> I am not able to reproduce this observation. Anyway, I have added dispose in finally block
It is because the test is not failing right now, you can change `>` to `<` in `if (0 > this.test.getSelectedIndex()) {` to fail the test.
It will still hang after latest modifications when launched with `java Test8019180.java` because of `LATCH` is still awaiting for its `countdown` (which is not called after throwing an exception).
It is not an issue if you run it with jtreg.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8293
More information about the client-libs-dev
mailing list