From b442c9dbddfb99697293c75e913c80a73fb14f32 Mon Sep 17 00:00:00 2001 From: "mastra-platform[bot]" Date: Tue, 17 Nov 2026 03:44:57 +0000 Subject: [PATCH] test(core): assert the stored error when a restarted run had failed The failed-race test checked the status, the stored snapshot and the lease, but never the error on the result restart() returns, so the failed branch of #storedRestartResult could drop the error without failing a test. Assert it is an Error carrying the message the step threw. Co-Authored-By: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com> --- .../core/src/mastra/restart-active-runs-ownership.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/mastra/restart-active-runs-ownership.test.ts b/packages/core/src/mastra/restart-active-runs-ownership.test.ts index 53feb911794..3f7180383f0 100644 --- a/packages/core/src/mastra/restart-active-runs-ownership.test.ts +++ b/packages/core/src/mastra/restart-active-runs-ownership.test.ts @@ -215,6 +215,10 @@ describe('boot-time workflow recovery and run ownership (#25579)', () => { const result = await restarted; expect(executions).toEqual([`A:${run.runId}`]); expect(result.status).toBe('failed'); + if (result.status === 'failed') { + expect(result.error).toBeInstanceOf(Error); + expect(result.error.message).toBe('step failed'); + } expect(await workflowsStore.getWorkflowRunById({ workflowName: 'recoverable-wf', runId: run.runId })).toEqual( storedAfterSettle, );