Skip to content

Commit

Permalink
Improve reliability of RunEvery test on slow VMs
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlauer committed Nov 28, 2023
1 parent 0cad819 commit 2bb2cc0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import static com.fizzed.crux.util.TimeDuration.millis;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.lessThan;
import static org.junit.Assert.*;
import static com.fizzed.crux.util.RunEvery.runEvery;

Expand All @@ -20,7 +22,8 @@ public void testRunEvery() throws InterruptedException {
Thread.sleep(100L);
}

assertThat(runCount, is(2));
assertThat(runCount.value(), greaterThan(1));
assertThat(runCount.value(), lessThan(4));
}

}

0 comments on commit 2bb2cc0

Please sign in to comment.