sleep as little as possible in time-critical tests

This commit is contained in:
Spine
2025-07-28 16:55:16 +02:00
parent 1fbf231c6c
commit 82376f08df
6 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ class UserMultiFactorAuthTest extends TestCase {
$burn = array_pop($recovery);
$this->assertFalse($mfa->burnRecovery('no such key'), 'utest-no-burn-mfa');
$this->assertTrue($mfa->burnRecovery($burn), 'utest-burn-mfa');
sleep(1); // pg table's time resolution is too low and causes race
Helper::sleepTick(); // pg table's time resolution is too low and causes race
$this->assertEquals(9, $this->countTokens(), 'utest-less-mfa');
$this->assertFalse($mfa->burnRecovery($burn), 'utest-burn-twice-mfa');