mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-25 08:32:11 +03:00
test(db): make exclusive-connection-lease uniqueness test self-contained (#11341)
Merged via consolidated batch validation. Test-only fix: exclusive-connection-lease uniqueness test implicitly depended on lease state from an earlier test in the same file (shared DB instance, reset only in test.after) — now self-contained. No production change.
This commit is contained in:
@@ -61,6 +61,19 @@ test("uses the live next-free migration slot without runner compatibility specia
|
||||
});
|
||||
|
||||
test("enforces global active owner and connection uniqueness", () => {
|
||||
// Establish the OWNER_A/conn-a lease this test reuses, rather than depending
|
||||
// on a lease left behind by an earlier test in the file. The DB instance is
|
||||
// shared across tests (reset only in test.after), so relying on prior state
|
||||
// makes this test order-dependent: run in isolation the re-acquire below
|
||||
// returns ACQUIRED instead of REUSED.
|
||||
leases.acquireExclusiveConnectionLease({
|
||||
leaseOwnerId: OWNER_A,
|
||||
apiKeyId: "key-a",
|
||||
provider: "codex",
|
||||
connectionId: "conn-a",
|
||||
now: at(0),
|
||||
});
|
||||
|
||||
const ownerA = leases.acquireExclusiveConnectionLease({
|
||||
leaseOwnerId: OWNER_A,
|
||||
apiKeyId: "key-a",
|
||||
|
||||
Reference in New Issue
Block a user