Wait for the full maintenance observation deadline

Measure idle observations with a monotonic clock and repeat an early timer wait until the mandatory90-second deadline. Preserve all application traffic and connection closure assertions.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-31 02:17:24 -05:00
1 parent d6b4491a24
commit d780fb9112
1 file changed
+5 -3
@@ -67,9 +67,11 @@ describeDatabase("assembled maintenance server production wiring", () => {
const before = await server.snapshot(), queryCount = server.proxy.queries.length, frames = server.proxy.frames, transport = server.proxy.transport;
expect(before.startup.phase).toBe("ready"); expect(before.idle.active).toBe(0);
await server.realtime();
const wallStart = Date.now();
await delay(90_000);
const wallElapsedMs = Date.now() - wallStart;
const wallStart = performance.now();
for (let remaining = 90_000; remaining > 0; remaining = 90_000 - (performance.now() - wallStart)) {
await delay(Math.ceil(remaining));
}
const wallElapsedMs = performance.now() - wallStart;
await server.freeze();
const real = await server.settled(100);
expect(wallElapsedMs).toBeGreaterThanOrEqual(90_000);