Changeset 18602 in josm for trunk


Ignore:
Timestamp:
2022-11-22T14:01:54+01:00 (17 months ago)
Author:
taylor.smock
Message:

See r18598, fix tests under Java 18/19

This was caused by a race condition where the bug report thread finished prior
to the not null check in Java 8, but almost always does not under Java 18/19.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java

    r18598 r18602  
    3636import mockit.Mock;
    3737import mockit.MockUp;
     38import org.awaitility.Awaitility;
     39import org.awaitility.Durations;
    3840import org.junit.jupiter.api.Test;
    3941import org.junit.jupiter.api.extension.RegisterExtension;
     
    222224            assertDoesNotThrow(MainApplication::setupUIManager);
    223225
     226            /* We cannot sync on the worker or EDT threads since the bug report handler makes a new thread */
     227            Awaitility.await().atMost(Durations.ONE_HUNDRED_MILLISECONDS)
     228                    .pollDelay(Durations.ONE_MILLISECOND)
     229                    .until(() -> !BugReportQueue.getInstance().exceptionHandlingInProgress());
    224230            assertNotNull(exceptionAtomicReference.get());
    225231            assertTrue(exceptionAtomicReference.get() instanceof UnsupportedOperationException);
Note: See TracChangeset for help on using the changeset viewer.