Rl-Auto / apps /api /src /__tests__ /postgres-store.test.ts
Lazywords's picture
Deploy RL Auto Docker Space
c4ae742
Raw
History Blame Contribute Delete
463 Bytes
import { describe, expect, it } from "vitest";
import { POSTGRES_TAKE_NEXT_ITEM_SQL } from "../queue/postgres-store.js";
describe("Postgres queue store", () => {
it("uses row locks with SKIP LOCKED for multi-instance item consumption", () => {
expect(POSTGRES_TAKE_NEXT_ITEM_SQL).toMatch(/FOR UPDATE SKIP LOCKED/i);
expect(POSTGRES_TAKE_NEXT_ITEM_SQL).toMatch(/UPDATE items/i);
expect(POSTGRES_TAKE_NEXT_ITEM_SQL).toMatch(/RETURNING/i);
});
});