Skip flaky StopWatch time assertions

This commit is contained in:
Juergen Hoeller 2021-09-27 17:11:12 +02:00
parent d8e18f56e1
commit 119c78b1c9
1 changed files with 3 additions and 0 deletions

View File

@ -97,6 +97,8 @@ class StopWatchTests {
assertThat(stopWatch.currentTaskName()).isEqualTo(name2);
stopWatch.stop();
assertThat(stopWatch.isRunning()).isFalse();
/* Flaky StopWatch time assertions...
assertThat(stopWatch.getLastTaskTimeNanos())
.as("last task time in nanoseconds for task #2")
.isGreaterThanOrEqualTo(millisToNanos(duration2))
@ -109,6 +111,7 @@ class StopWatchTests {
.as("total time in seconds for task #2")
.isGreaterThanOrEqualTo((duration1 + duration2 - fudgeFactor) / 1000.0)
.isLessThanOrEqualTo((duration1 + duration2 + fudgeFactor) / 1000.0);
*/
assertThat(stopWatch.getTaskCount()).isEqualTo(2);
assertThat(stopWatch.prettyPrint()).contains(name1, name2);