mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 15:47:28 +00:00
test: wait for qqbot queue drain
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { createMessageQueue, mergeGroupMessages, type QueuedMessage } from "./message-queue.js";
|
||||
|
||||
function groupMsg(overrides: Partial<QueuedMessage> = {}): QueuedMessage {
|
||||
@@ -206,7 +206,9 @@ describe("engine/gateway/message-queue", () => {
|
||||
throw new Error("Expected QQBot queue gate callback to be initialized");
|
||||
}
|
||||
gate();
|
||||
await new Promise((res) => setTimeout(res, 0));
|
||||
await vi.waitFor(() => {
|
||||
expect(seen.length).toBeGreaterThan(1);
|
||||
});
|
||||
const seenIds = seen.map((m) => m.messageId);
|
||||
expect(seenIds).toContain("First");
|
||||
// The bot message should NOT have been processed — it was evicted.
|
||||
|
||||
Reference in New Issue
Block a user