Changeset 19082 in josm


Ignore:
Timestamp:
2024-05-14T23:54:51+02:00 (6 months ago)
Author:
taylor.smock
Message:

Fix intermittent test failures

This fixes at least one cause of the intermittent test failures.
The root cause is a thread creating an ImageViewerDialog instance after the
teardown method was called.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java

    r18895 r19082  
    1212import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1313import org.openstreetmap.josm.testutils.annotations.Main;
     14import org.openstreetmap.josm.testutils.annotations.ThreadSync;
    1415
    1516/**
     
    2223    @AfterEach
    2324    void tearDown() {
     25        // We need to ensure that all threads are "done" before continuing.
     26        // Otherwise, other tests may have an ImageViewerDialog that causes issues...
     27        // Note: we cannot (currently) use the ThreadSync annotation since it runs
     28        // *after* local AfterEach and AfterAll methods.
     29        new ThreadSync.ThreadSyncExtension().threadSync();
    2430        if (ImageViewerDialog.hasInstance()) {
    2531            ImageViewerDialog.getInstance().destroy();
Note: See TracChangeset for help on using the changeset viewer.