From fe9bbb18bfd733bb3c867d625508bbcdca6e944b Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 31 Oct 2026 04:55:00 -0700 Subject: [PATCH] refactor(cloud): group relay assignment locking tests (#36671) --- .../assignment-control-supersession-postgres.test.ts | 4 ++-- .../assignment-row-lock-order-postgres.test.ts | 4 ++-- .../{ => assignment}/assignment-store-lock-order.test.ts | 6 +++--- config/reliability-gates.jsonc | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) rename cloud/apps/relay/src/{ => assignment}/assignment-control-supersession-postgres.test.ts (97%) rename cloud/apps/relay/src/{ => assignment}/assignment-row-lock-order-postgres.test.ts (97%) rename cloud/apps/relay/src/{ => assignment}/assignment-store-lock-order.test.ts (99%) diff --git a/cloud/apps/relay/src/assignment-control-supersession-postgres.test.ts b/cloud/apps/relay/src/assignment/assignment-control-supersession-postgres.test.ts similarity index 97% rename from cloud/apps/relay/src/assignment-control-supersession-postgres.test.ts rename to cloud/apps/relay/src/assignment/assignment-control-supersession-postgres.test.ts index 756706a182b..ac13bf5001f 100644 --- a/cloud/apps/relay/src/assignment-control-supersession-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-control-supersession-postgres.test.ts @@ -1,6 +1,6 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' -import { openRelayDatabase, type RelayDatabase } from './database.js' +import { RelayAssignmentStore } from '../assignment-store.js' +import { openRelayDatabase, type RelayDatabase } from '../database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL const describePostgres = databaseUrl ? describe : describe.skip diff --git a/cloud/apps/relay/src/assignment-row-lock-order-postgres.test.ts b/cloud/apps/relay/src/assignment/assignment-row-lock-order-postgres.test.ts similarity index 97% rename from cloud/apps/relay/src/assignment-row-lock-order-postgres.test.ts rename to cloud/apps/relay/src/assignment/assignment-row-lock-order-postgres.test.ts index 5d76473dd01..41f8b26a557 100644 --- a/cloud/apps/relay/src/assignment-row-lock-order-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-row-lock-order-postgres.test.ts @@ -1,6 +1,6 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' -import { openRelayDatabase, type RelayDatabase } from './database.js' +import { RelayAssignmentStore } from '../assignment-store.js' +import { openRelayDatabase, type RelayDatabase } from '../database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL const describePostgres = databaseUrl ? describe : describe.skip diff --git a/cloud/apps/relay/src/assignment-store-lock-order.test.ts b/cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts similarity index 99% rename from cloud/apps/relay/src/assignment-store-lock-order.test.ts rename to cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts index fa670b0ae7f..787f8524546 100644 --- a/cloud/apps/relay/src/assignment-store-lock-order.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' -import type { RelayDatabase, RelayLockOptions, SqlRow } from './database.js' -import { openInMemoryRelayDatabase } from './database.js' +import { RelayAssignmentStore } from '../assignment-store.js' +import type { RelayDatabase, RelayLockOptions, SqlRow } from '../database.js' +import { openInMemoryRelayDatabase } from '../database.js' const identity = { userId: 'user-a', relayHostId: 'host000000000001' } const activityId = 'splice:connection-1' diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index bd3609cb7da..f8b3b05f463 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -20732,13 +20732,13 @@ "invariant": "A single-cell capacity check reads only that cell while retaining snapshot freshness, incarnation, outstanding reservation and missing-limit policy; new placement retains the full fleet inventory.", "oracle": "With 32 capped cells, an existing active host stays on its pinned cell and reads one headroom row; new placement reads all 32. Missing, expired or prior-incarnation snapshots, capacity exhaustion and outstanding debt still refuse the active pinned host; an uncapped cell remains admissible.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false" + "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false" ], "testFiles": [ "cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts", "cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts", "cloud/apps/relay/src/assignment-store.test.ts", - "cloud/apps/relay/src/assignment-store-lock-order.test.ts", + "cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts", "cloud/apps/relay/src/cell-inventory-lock-contention.test.ts", "cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts", "cloud/apps/relay/src/regional-rehome-target-selection.test.ts" @@ -20760,7 +20760,7 @@ "date": "2026-09-25", "runner": "local", "platform": "macos", - "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false", + "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false", "result": "passed", "durationSeconds": 0.513, "summary": "189 tests across seven files passed; independent root rerun also passed189 tests. Relay typecheck passed separately."