Skip to content

Commit 2d794dd

Browse files
committed
Add 100 ms instead of 1 s to the timeout in runKeywords waitFor wrapper
1 parent 408c708 commit 2d794dd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/JavaFXLibrary.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public Object runKeyword(String keywordName, Object[] args) {
8181
AtomicReference<RuntimeException> retExcep = new AtomicReference<>();
8282

8383
try {
84-
// timeout + 1 so that underlying timeout has a chance to expire first
85-
WaitForAsyncUtils.waitFor(getWaitUntilTimeout() + 1, TimeUnit.SECONDS, () -> {
84+
// timeout + 100 ms so that underlying timeout has a chance to expire first
85+
WaitForAsyncUtils.waitFor(getWaitUntilTimeout(TimeUnit.MILLISECONDS) + 100, TimeUnit.MILLISECONDS, () -> {
8686

8787
try {
8888
retval.set(super.runKeyword(keywordName, finalArgs));

src/main/java/javafxlibrary/utils/HelperFunctions.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ public static int getWaitUntilTimeout() {
414414
return waitUntilTimeout;
415415
}
416416

417+
public static long getWaitUntilTimeout(TimeUnit timeUnit) {
418+
return timeUnit.convert(waitUntilTimeout, TimeUnit.SECONDS);
419+
}
420+
417421
public static void checkClickLocation(int x, int y) {
418422
checkClickLocation(new Point2D(x, y));
419423
}

0 commit comments

Comments
 (0)