From ea72585c5b0f4f7ef8fa56d670f0f02c88d4724a Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 9 Jun 2026 21:11:21 +0400 Subject: [PATCH] Bound TOTP rotation wait in account tests --- tests/e2e/Services/Account/AccountCustomClientTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index 36a80662d8..1928b0b1c8 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -133,12 +133,18 @@ final class AccountCustomClientTest extends Scope protected function getNextTOTP(\OTPHP\TOTP $totp, string $previousOtp): string { + $deadline = time() + 35; + do { sleep(1); $otp = $totp->now(); - } while ($otp === $previousOtp); - return $otp; + if ($otp !== $previousOtp) { + return $otp; + } + } while (time() < $deadline); + + $this->fail('TOTP did not rotate within the expected time window.'); } /**