diff --git a/test/workflow-judge-cache.test.ts b/test/workflow-judge-cache.test.ts index 5e230bbff..209111833 100644 --- a/test/workflow-judge-cache.test.ts +++ b/test/workflow-judge-cache.test.ts @@ -177,13 +177,12 @@ test('workflow registration preserves model work and reserves only terminal-reco .map(stage => body.indexOf(stage)); expect(stages.every(position => position >= 0)).toBe(true); expect(stages).toEqual([...stages].sort((a, b) => a - b)); - expect(body).toContain("execution: reused ? 'reused' : 'executed'"); - expect(body).toContain('const workDeadline = started + JUDGE_MS;'); - expect(source).toContain('const WORKFLOW_JUDGE_RECORD_MS = 5_000;'); - expect(source).toContain('const WORKFLOW_JUDGE_TEST_MS = JUDGE_MS + 10_000;'); - expect(source.match(/\}, WORKFLOW_JUDGE_TEST_MS\);/g)).toHaveLength(17); - expect(source).toContain("testName: 'review/SKILL.md workflow'"); - expect(source.match(/\}, JUDGE_MS\);/g)).toHaveLength(7); + const calls = [...source.matchAll(/await runWorkflowJudge\(/g)].map(match => match.index!); + expect(calls.length).toBeGreaterThan(0); + for (const call of calls) { + const timeout = /\n\s*\}, (\w+)\);/.exec(source.slice(call))?.[1]; + expect(timeout, `runWorkflowJudge registration at offset ${call} must use WORKFLOW_JUDGE_TEST_MS`).toBe('WORKFLOW_JUDGE_TEST_MS'); + } }); function actualCallback(f: ReturnType, overrides: {