[BUGFIX] Stabilize flaky TimeTracker unit test 60/54260/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 2 Oct 2017 12:50:28 +0000 (14:50 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 2 Oct 2017 19:35:38 +0000 (21:35 +0200)
The time tracker sometimes switches between two milliseconds
in its operation. Test a bit weaker to cope with that.

Change-Id: I20d58296749bf33b12ab2da72691ecf4853842eb
Resolves: #82635
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54260
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Tests/Unit/TimeTracker/TimeTrackerTest.php

index 423003e..8d83218 100644 (file)
@@ -26,7 +26,7 @@ class TimeTrackerTest extends UnitTestCase
     /**
      * @test
      */
-    public function getParseTimeReturnsZeroIfNoValuesAreSet()
+    public function getParseTimeReturnsZeroOrOneIfNoValuesAreSet()
     {
         unset(
             $GLOBALS['TYPO3_MISC']['microtime_end'],
@@ -35,7 +35,7 @@ class TimeTrackerTest extends UnitTestCase
             $GLOBALS['TYPO3_MISC']['microtime_BE_USER_end']
         );
         $parseTime = (new TimeTracker())->getParseTime();
-        self::assertSame(0, $parseTime);
+        self::assertLessThanOrEqual(1, $parseTime);
     }
 
     /**