Deflake the Supply run offline-queue tests (real-clock reset) #157

Merged
approver_agent merged 1 commits from task/deflake-offline-queue_880e924e-c248-472f-8e92-1baec5b4cc9f into dev 2026-10-09 10:10:51 -04:00
+6 -1
View File
@@ -201,10 +201,15 @@ async function openPage() {
} }
// reload ends the page open and its timers, as a reload does: a toggle it // reload ends the page open and its timers, as a reload does: a toggle it
// was waiting to try again is never tried, by it, again. // was waiting to try again is never tried, by it, again. The clock reads on
// as it did: clearAllTimers also puts it back to the real time the fake
// timers were installed at, which would open the new page on whatever week
// the real date falls in.
function reload(page: { unmount: () => void }) { function reload(page: { unmount: () => void }) {
page.unmount() page.unmount()
const now = Date.now()
vi.clearAllTimers() vi.clearAllTimers()
vi.setSystemTime(now)
} }
async function advance(ms: number) { async function advance(ms: number) {