Skip to content

Commit 3bf40dd

Browse files
committed
test(core): the resumed unwind halt is a stated halt, not a compensate() over no rows
Claude-Session: https://claude.ai/code/session_01DDZNkDVwPQnevTFcYE47H3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent ee6c362 commit 3bf40dd

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/core/src/utils/migration-journal.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,11 @@ describe('a resume compares what the run started over, not what load() returns n
599599
expect(await chunkEvents(restarted, runId, 'compensated')).toEqual([1]);
600600
const failure = (await readRunJournal(asEngine(restarted), runId)).at(-1)!;
601601
expect(failure).toMatchObject({ kind: 'run_failed', chunk_index: 0 });
602-
expect(JSON.parse(failure.detail!)).toMatchObject({ phase: 'compensate', step: 'shrinking' });
602+
const detail = JSON.parse(failure.detail!);
603+
expect(detail).toMatchObject({ phase: 'compensate', step: 'shrinking' });
604+
// A halt that says why — not a compensate() that was handed no rows and threw.
605+
expect(detail).toHaveProperty('reason');
606+
expect(detail).not.toHaveProperty('error');
603607
});
604608
});
605609

‎packages/core/src/utils/migration-journal.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ function planResumedRun(
610610
* step's preflight fails; the plan declares `onCrash: 'compensate'` but some
611611
* step cannot compensate; or a resume's plan disagrees with what its run
612612
* started over — its hash, or rows that bind to that chunk plan under neither
613-
* reading `planResumedRun` accepts.
613+
* reading {@link MigrationPlanStep.load} documents.
614614
*/
615615
export async function runMigrationJournal(
616616
engine: IObjectQLEngine,

0 commit comments

Comments
 (0)