| 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); | |
| }); | |
| }); | |