From e2752ba2fa92fdaa36ec340ed6fbb48549992ed6 Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 18 Aug 2026 17:37:17 +0000 Subject: [PATCH] test(runner): align integration fixtures Co-Authored-By: Paperclip --- .../src/__tests__/instance-settings-service.test.ts | 1 + .../__tests__/native-finalization-migration.test.ts | 4 ++-- .../recovery-stale-issue-lock-sweep.test.ts | 12 ++++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/server/src/__tests__/instance-settings-service.test.ts b/server/src/__tests__/instance-settings-service.test.ts index 4c5627f4170..bc67360a32a 100644 --- a/server/src/__tests__/instance-settings-service.test.ts +++ b/server/src/__tests__/instance-settings-service.test.ts @@ -26,6 +26,7 @@ describe("instance settings service", () => { enableNewestFirstIssueThread: true, })).toEqual({ enableEnvironments: true, + enableNativeRunner: false, enableManagedSandboxOnly: false, enableIsolatedWorkspaces: true, enableStreamlinedLeftNavigation: true, diff --git a/server/src/__tests__/native-finalization-migration.test.ts b/server/src/__tests__/native-finalization-migration.test.ts index f11887647ba..326a3d47328 100644 --- a/server/src/__tests__/native-finalization-migration.test.ts +++ b/server/src/__tests__/native-finalization-migration.test.ts @@ -14,7 +14,7 @@ describe("P6-18 / MIG-01..04 native finalization migration", () => { it("repairs only later duplicates and preserves legacy event bytes and cursors", async () => { const temporary = await startEmbeddedPostgresTestDatabase("paperclip-native-migration-"); const migration = await readFile( - new URL("../../../packages/db/src/migrations/0211_famous_guardsmen.sql", import.meta.url), + new URL("../../../packages/db/src/migrations/0224_flippant_goliath.sql", import.meta.url), "utf8", ); const migrationHash = createHash("sha256").update(migration).digest("hex"); @@ -23,7 +23,7 @@ describe("P6-18 / MIG-01..04 native finalization migration", () => { const companyId = "10000000-0000-4000-8000-000000000001"; const agentId = "10000000-0000-4000-8000-000000000002"; const runId = "10000000-0000-4000-8000-000000000003"; - // Reconstruct the actual pre-0211 shape rather than extracting selected + // Reconstruct the actual pre-0224 shape rather than extracting selected // repair statements from the migration under test. await rawDb.execute(sql.raw(` DROP TABLE IF EXISTS status_decision_effects, status_decisions, work_assessments, diff --git a/server/src/__tests__/recovery-stale-issue-lock-sweep.test.ts b/server/src/__tests__/recovery-stale-issue-lock-sweep.test.ts index 718dde80c50..c1bed88042b 100644 --- a/server/src/__tests__/recovery-stale-issue-lock-sweep.test.ts +++ b/server/src/__tests__/recovery-stale-issue-lock-sweep.test.ts @@ -549,13 +549,9 @@ describeEmbeddedPostgres("recovery sweepStaleIssueLocks", () => { // Make only the audit-event insert fail. The run update commits the // terminal status first, so the audit write is best-effort. The sweep must // catch the failure and still clear the lock. - const realInsert = db.insert.bind(db); - const insertSpy = vi.spyOn(db, "insert").mockImplementation((table) => { - if (table === heartbeatRunEvents) { - throw new Error("simulated audit write failure"); - } - return realInsert(table); - }); + const transactionSpy = vi + .spyOn(db, "transaction") + .mockRejectedValueOnce(new Error("simulated audit write failure")); try { const heartbeat = heartbeatService(db); @@ -564,7 +560,7 @@ describeEmbeddedPostgres("recovery sweepStaleIssueLocks", () => { expect(result.terminalizedRunIds).toEqual([runningRunId]); expect(result.cleared).toBe(1); } finally { - insertSpy.mockRestore(); + transactionSpy.mockRestore(); } // The run reached its terminal status even though the audit write failed.