{"record":{"id":"5a63fdfa50f2f59c","repo":"pestphp/pest","slug":"cached-failure","errorCode":null,"errorMessage":"Cached failure","messagePattern":"Cached failure","errorType":"exception","errorClass":"AssertionFailedError","httpStatus":null,"severity":"error","filePath":"src/Concerns/Testable.php","lineNumber":219,"sourceCode":"        self::$__latestNotes = $method->notes;\n        self::$__latestIssues = $method->issues;\n        self::$__latestPrs = $method->prs;\n\n        /** @var Tia $tia */\n        $tia = Container::getInstance()->get(Tia::class);\n        $status = $tia->getStatus(self::$__filename, $this->valueObjectForEvents()->id());\n        $replay = ReplayType::fromStatus($status);\n\n        if ($replay !== ReplayType::None) {\n            assert($status !== null);\n\n            $this->__replay = $replay;\n\n            match ($replay) {\n                ReplayType::Pass, ReplayType::Risky => $this->__beginReplay($replay, $tia),\n                ReplayType::Skipped => $this->markTestSkipped($status->message()),\n                ReplayType::Incomplete => $this->markTestIncomplete($status->message()),\n                ReplayType::Failure => throw new AssertionFailedError($status->message() ?: 'Cached failure'),\n            };\n\n            return;\n        }\n\n        $recorder = Container::getInstance()->get(Recorder::class);\n        assert($recorder instanceof Recorder);\n\n        if ($recorder->isActive()) {\n            $recorder->beginTest($this::class, $this->name(), self::$__filename);\n        }\n\n        parent::setUp();\n\n        Collectors::armAll($recorder);\n\n        $beforeEach = TestSuite::getInstance()->beforeEach->get(self::$__filename)[1];\n","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/pestphp/pest/blob/1af74a215c3a89bc7a44fc6f9322e369eaad2423/src/Concerns/Testable.php#L201-L237","documentation":"With test-influence analysis (--tia), Pest caches per-test results and, on later runs, replays the cached verdict for tests unaffected by your changes instead of re-executing them. When the cached status resolves to ReplayType::Failure, Pest rethrows an AssertionFailedError carrying the stored failure message; if that stored message is empty it falls back to the literal text 'Cached failure'. Hitting it means a previously failing test was replayed from the TIA graph, so the test did not actually run this time.","triggerScenarios":"Running vendor/bin/pest --tia after an earlier failing run, then editing files the TIA graph considers unrelated to that test; a failure status recorded without a message (empty diff/message in the cache), producing the 'Cached failure' default text; a stale TIA cache left over from before a branch switch.","commonSituations":"Teams enabling TIA to speed up large suites; CI or local caches (.pest tia graph) surviving branch switches or force-pushes; debugging confusion because the failure output shows no diff — only the cached message.","solutions":["Re-run the same test without --tia (or delete the TIA cache) to execute the test for real and get the full failure output.","Treat the cached verdict as genuine: fix the underlying failing test, then let the next --tia run record a passing status.","If the cache is stale or suspicious (e.g., after a big rebase), clear the TIA cache directory so the next run records fresh statuses."],"exampleFix":"# before\nvendor/bin/pest --tia          # replays: 'Cached failure' with no diff\n# after\nvendor/bin/pest tests/Unit/ThatTest.php   # real run, full diff\nrm -rf .pest  # or clear the tia cache to force fresh recording","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat any 'Cached failure' as a real failure: fix the test, don't try to suppress the replay.","Clear the TIA cache after branch switches, rebases, or dependency updates so stale verdicts cannot replay.","When a cached failure lacks a diff, re-run the exact test without --tia to see the real output before debugging."],"tags":["pest","tia","cache","replay","assertion-failure"],"backgroundTag":"test-result-cache-replay","analyzedSha":"1af74a215c3a89bc7a44fc6f9322e369eaad2423","analyzedAt":"2026-08-21T02:16:38.132Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}