Skip to content

Commit

Permalink
Timing is not precise.
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardladenthin committed Mar 18, 2024
1 parent a212b73 commit e5a8544
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ public void interrupt_keysAdded_waitedInternallyForTheDuration() throws IOExcept
// assert
long afterAct = System.currentTimeMillis();
Duration waitTime = Duration.ofMillis(afterAct-beforeAct);
// assert the minimum waiting time is over
assertThat(waitTime, is(greaterThan(ConsumerJava.DURATION_WAIT_QUEUE_EMPTY)));

// assert the minimum waiting time is over, substract a few seconds, its not precise
assertThat(waitTime, is(greaterThan(ConsumerJava.DURATION_WAIT_QUEUE_EMPTY.minus(Duration.ofSeconds(2)))));
}

@Test
Expand Down

0 comments on commit e5a8544

Please sign in to comment.