Skip to content

Commit c2e29ab

Browse files
committed
test(run-store): assert every lock column rolls back, not just the run status
The lockRunToWorker atomicity test proxied "fully rolled back" through the run status alone, which would miss a partial rollback that leaves lockedAt/lockedById and friends populated. Assert those columns are null too.
1 parent 3c00f14 commit c2e29ab

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal-packages/run-store/src/PostgresRunStore.writeAtomicity.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,13 @@ describe("createExecutionSnapshot / lockRunToWorker write the snapshot and its l
701701

702702
const snap = await prisma17.taskRunExecutionSnapshot.findUnique({ where: { id: snapshotId } });
703703
expect(snap).toBeNull();
704+
// The whole lock write must roll back, not just the status: no lock columns may leak through.
704705
const run = await prisma17.taskRun.findUniqueOrThrow({ where: { id: runId } });
705706
expect(run.status).not.toBe("DEQUEUED");
707+
expect(run.lockedAt).toBeNull();
708+
expect(run.lockedById).toBeNull();
709+
expect(run.lockedToVersionId).toBeNull();
710+
expect(run.lockedQueueId).toBeNull();
706711
}
707712
);
708713
});

0 commit comments

Comments
 (0)