Files
ghbot/test/conflict-lock.test.ts
T
wdawdwaandClaude Opus 4.8 039acabd96 fix: production hardening for merge races, timeouts, and webhook ops
Pin merge SHA, lock conflict repair, bound subprocess/proxy output,
fail-fast incomplete R2/webhook config, redact validation/stderr
secrets, and document that webhook 202 is best-effort after ACK.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-23 15:44:08 +08:00

19 lines
708 B
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
import { acquireConflictLock } from "../src/review/conflictResolver.js";
test("conflict lock rejects overlapping runs for the same pull request", async () => {
const release = await acquireConflictLock("acme/demo#7");
await assert.rejects(() => acquireConflictLock("acme/demo#7"), /already active/);
release();
const releaseAgain = await acquireConflictLock("acme/demo#7");
releaseAgain();
});
test("conflict lock allows concurrent runs for different pull requests", async () => {
const first = await acquireConflictLock("acme/demo#8");
const second = await acquireConflictLock("acme/demo#9");
first();
second();
});