Merge recovery fixture settlement repairs into sleep-03-gateway-credential-expiry

Propagate the verified foreground recovery and login cleanup fixture corrections while preserving this PR boundary.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-26 21:10:06 -05:00
commit 7e8dffbcc7
2 files changed
+24 -1

No files matched your search

@@ -116,7 +116,13 @@ describe.skipIf(!support.supported)("durable login cleanup", () => {
});
async function settle(ms = 30_000) {
await vi.advanceTimersByTimeAsync(ms);
await vi.waitFor(() => expect(idleWorkSnapshot().active).toBe(0), { timeout: 5000 });
await vi.waitFor(async () => {
if (idleWorkSnapshot().active > 0) {
const deadlines = coordinators.flatMap(c => c.nextWakeAt() === null ? [] : [c.nextWakeAt()!]);
if (deadlines.length) await vi.advanceTimersByTimeAsync(Math.max(0, Math.min(...deadlines) - Date.now()));
}
expect(idleWorkSnapshot().active).toBe(0);
}, { timeout: 5000 });
await vi.advanceTimersByTimeAsync(1);
await vi.waitFor(() => expect(idleWorkSnapshot().active).toBe(0), { timeout: 5000 });
expect(errors).toEqual([]);