RFR: 8359061: Update and ProblemList manual test java/awt/Cursor/CursorDragTest/ListDragCursor.java [v5]
Alexey Ivanov
aivanov at openjdk.org
Tue Jun 17 15:15:37 UTC 2025
On Mon, 16 Jun 2025 21:43:00 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:
>> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Rearrange and update test.
>
> test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 53:
>
>> 51: });
>> 52: countDownLatch.await();
>> 53: System.out.println("Test Passed");
>
> @DamonGuy
>
> Test continues to run if the user does not click on Pass/Fail buttons. It can be avoided by adding a timeout for the countdown latch as below and calling disposeFrames() in finally block.
>
> Suggestion:
>
> countDownLatch = new CountDownLatch(1);
> try {
> EventQueue.invokeAndWait(() -> {
> createTestFrame();
> createInstructionsFrame();
> });
>
> if (!countDownLatch.await(2, TimeUnit.MINUTES)) {
> throw new RuntimeException("Test timeout : No action was"
> + " taken on the test.");
> }
> System.out.println("Test passed.");
> } finally {
> EventQueue.invokeAndWait(ListDragCursor::disposeFrames);
> }
I'm for introducing the timeout, thank you!
The default timeout could be 5 minutes.
> test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 125:
>
>> 123:
>> 124: static void disposeFrames() {
>> 125: countDownLatch.countDown();
>
> countDownLatch.countDown(); needs to be removed from disposeFrames().
~~Why does it?~~
Got it! Pressing the buttons should just release the latch, then the main method disposes of the frames.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152503540
PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152492207
More information about the client-libs-dev
mailing list