Skip to content

Commit debb34f

Browse files
authored
Merge pull request #1118 from hydephp/update-test-to-account-for-time-drift
Update test to account for time drift
2 parents 55f4cf2 + 3c8382e commit debb34f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/framework/tests/Feature/TracksExecutionTimeTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public function test_startClock()
2121

2222
$this->assertTrue($class->isset('timeStart'));
2323
$this->assertIsFloat($class->timeStart);
24-
$this->assertSame(round(microtime(true)), round($class->timeStart));
24+
// Assert that the difference between the two is less than 1 second to account for time drift (causes 1/10 000 tests to fail)
25+
$this->assertLessThan(1, abs((microtime(true)) - ($class->timeStart)));
2526
}
2627

2728
public function test_stopClock()

0 commit comments

Comments
 (0)