mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-30 21:49:18 +01:00
Merge codex/sleep-25-voice-call-reports into codex/sleep-26-teams-consent-expiry
Co-Authored-By: Paperclip <noreply@paperclip.ing> * codex/sleep-25-voice-call-reports: test(server): verify voice report resume at its retained deadline test(server): verify retention resume at its retained deadline
This commit is contained in:
commit
0bb6de2343
3 files changed
+34
-4
No files matched your search
@@ -141,8 +141,13 @@ const support = external ? { supported: true } : await getEmbeddedPostgresTestSu
|
||||
});
|
||||
it("retains committed work during drain and ignores rolled-back nested writes", async () => {
|
||||
await start(); await flush(); enabled = false;
|
||||
const call = await session(); await quiet(60_000); expect(await report(call.id)).toBeUndefined();
|
||||
enabled = true; await flush(); expect(fetchReport).toHaveBeenCalledOnce();
|
||||
const call = await session(); await flush();
|
||||
const drained = idleWorkSnapshot();
|
||||
await quiet(60_000); expect(idleWorkSnapshot()).toEqual(drained); expect(await report(call.id)).toBeUndefined();
|
||||
const resumeAt = coordinator!.nextWakeAt(); expect(resumeAt).not.toBeNull();
|
||||
enabled = true; await vi.advanceTimersByTimeAsync(Math.max(0, resumeAt! - Date.now()));
|
||||
await vi.waitFor(async () => { await flush(); expect(fetchReport).toHaveBeenCalledOnce(); });
|
||||
expect(await report(call.id)).toMatchObject({ status: "available" });
|
||||
await expect(db.transaction(async tx => { await session({}, tx as unknown as typeof db); throw new Error("rollback"); })).rejects.toThrow("rollback");
|
||||
await flush(); expect(fetchReport).toHaveBeenCalledOnce(); await quiet();
|
||||
});
|
||||
|
||||
@@ -151,8 +151,13 @@ const support = external ? { supported: true } : await getEmbeddedPostgresTestSu
|
||||
});
|
||||
it("keeps the first write during drain and runs it on resume", async () => {
|
||||
await start(); await flush(); enabled = false;
|
||||
const call = await admission(); await quiet(60_000); expect(await row(call.id)).toBeDefined();
|
||||
enabled = true; await flush(); expect(await row(call.id)).toBeUndefined(); await quiet();
|
||||
const call = await admission(); await flush();
|
||||
const drained = idleWorkSnapshot();
|
||||
await quiet(60_000); expect(idleWorkSnapshot()).toEqual(drained); expect(await row(call.id)).toBeDefined();
|
||||
const resumeAt = coordinator!.nextWakeAt(); expect(resumeAt).not.toBeNull();
|
||||
enabled = true; await vi.advanceTimersByTimeAsync(Math.max(0, resumeAt! - Date.now()));
|
||||
await vi.waitFor(async () => { await flush(); expect(await row(call.id)).toBeUndefined(); });
|
||||
expect(coordinator!.nextWakeAt()).toBeNull(); await quiet();
|
||||
});
|
||||
it("pages through more than one batch of history across companies", async () => {
|
||||
for (let i = 0; i < 104; i++) await admission();
|
||||
|
||||
Reference in new issue
Block a user