mirror of
https://github.com/apache/commons-lang.git
synced 2025-03-03 06:29:18 +00:00
Try and avoid test failures on GitHub CI
This commit is contained in:
parent
c4007c4a24
commit
79c66ae4e3
@ -282,18 +282,21 @@ public void testStopWatchSimpleGet() throws InterruptedException {
|
||||
public void testStopWatchSplit() throws InterruptedException {
|
||||
final StopWatch watch = StopWatch.createStarted();
|
||||
sleep(MILLIS_550);
|
||||
// slept ~550 millis
|
||||
watch.split();
|
||||
final long splitTime = watch.getSplitTime();
|
||||
final String splitStr = watch.toSplitString();
|
||||
sleep(MILLIS_550);
|
||||
// slept ~1100 millis
|
||||
watch.unsplit();
|
||||
sleep(MILLIS_550);
|
||||
// slept ~1650 millis
|
||||
watch.stop();
|
||||
final long totalTime = watch.getTime();
|
||||
|
||||
assertEquals(12, splitStr.length(), "Formatted split string not the correct length");
|
||||
assertThat("splitTime", splitTime, allOf(greaterThanOrEqualTo(500L), lessThan(700L)));
|
||||
assertThat("totalTime", totalTime, allOf(greaterThanOrEqualTo(1500L), lessThan(2000L)));
|
||||
assertThat("totalTime", totalTime, allOf(greaterThanOrEqualTo(1500L), lessThan(2100L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user