Skip to content

Commit

Permalink
test(SimPinFeederTest): attempt to address test flakiness due to time…
Browse files Browse the repository at this point in the history
…out (#41)

This occurs only on 'release' builds... presumably because of bytecode
optimizations, which reduces overall execution time. To address this,
we'll allow a max. discrepancy of 250ms.

org.awaitility.core.ConditionTimeoutException: Condition was evaluated in 2 seconds 958 milliseconds which is earlier than expected minimum timeout 3 seconds
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:172)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:975)
	at com.github.iusmac.sevensim.telephony.SimPinFeederTest.assertTaskTimedOut(SimPinFeederTest.java:906)
	at com.github.iusmac.sevensim.telephony.SimPinFeederTest.test_ShouldFinishAfterExceedingFixedWaitTimeoutForSimStatusChangeEventWhenAvailableSimCardsDoNotRequirePin(SimPinFeederTest.java:219)

Signed-off-by: iusmac <[email protected]>
  • Loading branch information
iusmac authored Dec 6, 2024
1 parent a88d45e commit 6946b97
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,9 @@ private void assertTaskTimedOut() {
await()
.dontCatchUncaughtExceptions()
.pollInSameThread()
.atMost(TASK_WAIT_TIMEOUT_DURATION.plusMillis(250L))
.atLeast(Duration.ofSeconds(3))
.atMost(TASK_WAIT_TIMEOUT_DURATION)
.atLeast(TASK_WAIT_TIMEOUT_DURATION.minusMillis(250L))
.pollInterval(Duration.ofMillis(50))
.until(() -> mTask.getState() == TERMINATED);
}

Expand Down

0 comments on commit 6946b97

Please sign in to comment.