Skip to content

Commit 57eb230

Browse files
committed
test: don't cover sleeping on windows
1 parent 01ae655 commit 57eb230

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Tempest/Clock/tests/GenericClockTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public function test_that_generic_clock_returns_the_current_time(): void
3838

3939
public function test_that_generic_clock_sleeps(): void
4040
{
41+
if (PHP_OS_FAMILY === 'Windows') {
42+
$this->markTestSkipped('Sleeping on Windows is not precise enough.');
43+
}
44+
4145
$timeBefore = hrtime(true);
4246
new GenericClock()->sleep(milliseconds: 250);
4347
$timeAfter = hrtime(true);
@@ -47,6 +51,10 @@ public function test_that_generic_clock_sleeps(): void
4751

4852
public function test_that_generic_clock_sleeps_with_duration(): void
4953
{
54+
if (PHP_OS_FAMILY === 'Windows') {
55+
$this->markTestSkipped('Sleeping on Windows is not precise enough.');
56+
}
57+
5058
$timeBefore = hrtime(true);
5159
new GenericClock()->sleep(Duration::milliseconds(250));
5260
$timeAfter = hrtime(true);

0 commit comments

Comments
 (0)