Skip to content

Commit

Permalink
prevent CI test failures on Windows java 11, where 500ms are only 497…
Browse files Browse the repository at this point in the history
…ms sometimes

git-svn-id: https://josm.openstreetmap.de/svn/trunk@19270 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
stoecker committed Dec 11, 2024
1 parent cc1c607 commit 3bb871f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/unit/org/openstreetmap/josm/testutils/MapModeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.awt.event.MouseEvent;
import java.util.concurrent.TimeUnit;

import org.awaitility.Awaitility;
import org.awaitility.Durations;
Expand Down Expand Up @@ -80,7 +81,7 @@ public static void clickAt(int times, ILatLon location) {
public static void dragFromTo(ILatLon from, ILatLon to) {
MainApplication.getMap().mapMode.mousePressed(mouseClickAt(from));
// Some actions wait a period of time to avoid accidental dragging.
Awaitility.await().pollDelay(Durations.FIVE_HUNDRED_MILLISECONDS).atLeast(Durations.FIVE_HUNDRED_MILLISECONDS).until(() -> true);
Awaitility.await().pollDelay(Durations.FIVE_HUNDRED_MILLISECONDS).atLeast(490, TimeUnit.MILLISECONDS).until(() -> true);
MainApplication.getMap().mapMode.mouseDragged(mouseClickAt(from));
MainApplication.getMap().mapMode.mouseDragged(mouseClickAt(to));
MainApplication.getMap().mapMode.mouseReleased(mouseClickAt(to));
Expand Down

0 comments on commit 3bb871f

Please sign in to comment.