{"record":{"id":"9732c3c420c9809f","repo":"denoland/deno","slug":"test-failed","errorCode":null,"errorMessage":"Test failed","messagePattern":"Test failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lsp/testing/execution.rs","lineNumber":509,"sourceCode":"            test::TestEvent::SnapshotSummary(_) => {}\n            test::TestEvent::ForceEndReport => {}\n            test::TestEvent::Sigint => {}\n            test::TestEvent::Exit(_) => {}\n            test::TestEvent::IsolateExit(_, _) => {}\n          }\n        }\n\n        let elapsed = Instant::now().duration_since(earlier);\n        reporter.report_summary(&summary, &elapsed);\n\n        if used_only {\n          return Err(anyhow!(\n            \"Test failed because the \\\"only\\\" option was used\"\n          ));\n        }\n\n        if summary.failed > 0 {\n          return Err(anyhow!(\"Test failed\"));\n        }\n\n        Ok(())\n      })\n    };\n\n    let (join_results, result) = future::join(join_stream, handler).await;\n\n    // propagate any errors\n    for join_result in join_results {\n      join_result??;\n    }\n\n    result??;\n\n    Ok(())\n  }\n","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/lsp/testing/execution.rs#L491-L527","documentation":"Generic terminal error returned by the Deno LSP test runner when the run summary has at least one failure (summary.failed > 0). failed is incremented by failed tests, failed steps, cancelled tests, and uncaught errors emitted from test workers. The specific failure details were already reported per-test through the event stream before this error is returned, so the message itself carries no location information.","triggerScenarios":"Any LSP-driven test run (VS Code Test Explorer) in which at least one test or step fails, a test is cancelled, or TestEvent::UncaughtError fires from a worker. The handler returns this after reporter.report_summary once summary.failed is non-zero.","commonSituations":"Red suites run from the IDE; flaky tests cancelled on timeout; uncaught promise rejections inside a test module that fail the run even when all test bodies pass.","solutions":["Read the failure details reported before the summary — Test Explorer failure nodes or the Deno Language Server output panel name the failing tests and their errors.","Reproduce outside the LSP with `deno test <file>` (or `deno test --filter <name>`) for full stack traces.","Fix the failing tests, or address the uncaught error / cancellation source, then re-run the suite."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Failures arrive as this terminal error AFTER per-test results streamed in.\ntry {\n  await session.testRun(modules);\n} catch (err) {\n  if (err?.message === 'Test failed') {\n    // details are in the Deno.testEvent notifications already received:\n    // surface them (Test Explorer failures / report), never swallow silently\n    reportFailuresFromTestEvents();\n  } else {\n    throw err;\n  }\n}","preventionTips":["Consume the per-test results from the test event stream — the terminal error carries no failure details","Reproduce persistent failures with 'deno test <file>' outside the IDE for full stack traces","Remember cancelled (timed-out) tests and uncaught worker errors also increment the failure count"],"tags":["testing","deno-test","lsp","test-explorer"],"backgroundTag":"test-run-failed","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}