perf(test): tighten discord stall reaction test timing
This commit is contained in:
parent
be1f2a1348
commit
9092d783a4
@ -159,10 +159,12 @@ describe("processDiscordMessage ack reactions", () => {
|
|||||||
|
|
||||||
it("shows stall emojis for long no-progress runs", async () => {
|
it("shows stall emojis for long no-progress runs", async () => {
|
||||||
vi.useFakeTimers();
|
vi.useFakeTimers();
|
||||||
|
let releaseDispatch!: () => void;
|
||||||
|
const dispatchGate = new Promise<void>((resolve) => {
|
||||||
|
releaseDispatch = () => resolve();
|
||||||
|
});
|
||||||
dispatchInboundMessage.mockImplementationOnce(async () => {
|
dispatchInboundMessage.mockImplementationOnce(async () => {
|
||||||
await new Promise((resolve) => {
|
await dispatchGate;
|
||||||
setTimeout(resolve, 31_000);
|
|
||||||
});
|
|
||||||
return { queuedFinal: false, counts: { final: 0, tool: 0, block: 0 } };
|
return { queuedFinal: false, counts: { final: 0, tool: 0, block: 0 } };
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -170,7 +172,9 @@ describe("processDiscordMessage ack reactions", () => {
|
|||||||
// oxlint-disable-next-line typescript/no-explicit-any
|
// oxlint-disable-next-line typescript/no-explicit-any
|
||||||
const runPromise = processDiscordMessage(ctx as any);
|
const runPromise = processDiscordMessage(ctx as any);
|
||||||
|
|
||||||
await vi.advanceTimersByTimeAsync(40_000);
|
await vi.advanceTimersByTimeAsync(30_001);
|
||||||
|
releaseDispatch();
|
||||||
|
await vi.runAllTimersAsync();
|
||||||
|
|
||||||
await runPromise;
|
await runPromise;
|
||||||
const emojis = (
|
const emojis = (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user