Skip to content

Commit 8da558f

Browse files
authored
test(cryptography): account for time flakiness on windows (#1502)
1 parent cf937b2 commit 8da558f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/cryptography/tests/TimelockTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function test_uses_clock_to_sleep(): void
8181

8282
$elapsed = $clock->timestamp()->getMilliseconds() - $ms;
8383

84-
$this->assertSame(300, $elapsed);
84+
// Even if we mock the clock, there's a `microtime` call that may be off by a few ms on Windows
85+
$this->assertEqualsToMoreOrLess(300, $elapsed, margin: 0, windowsMargin: 2);
8586
}
8687
}

0 commit comments

Comments
 (0)