{"record":{"id":"d4bdf277ecd39f4c","repo":"stablyai/orca","slug":"electron-trial-did-not-report-a-result-status-r","errorCode":null,"errorMessage":"Electron trial did not report a result (status ${result.status})","messagePattern":"Electron trial did not report a result \\(status (.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/hang-watchdog-memory-benchmark.mjs","lineNumber":354,"sourceCode":"        env,\n        encoding: 'utf8',\n        timeout: 90_000\n      })\n    } finally {\n      rmSync(launcherDir, { recursive: true, force: true })\n    }\n    if (result.status !== 0) {\n      throw new Error(\n        `Electron trial failed (${result.error?.message ?? result.signal ?? result.status}):\\n` +\n          `${result.stderr || result.stdout}`\n      )\n    }\n    const line = result.stdout.split('\\n').find((candidate) => candidate.startsWith(RESULT_PREFIX))\n    if (line) {\n      return { ...JSON.parse(line.slice(RESULT_PREFIX.length)), launchAttempts: attempt }\n    }\n    if (attempt === MAX_LAUNCH_ATTEMPTS || result.stderr || result.stdout) {\n      throw new Error(`Electron trial did not report a result (status ${result.status})`)\n    }\n  }\n  throw new Error('Electron trial exhausted launcher attempts')\n}\n\nfunction runBenchmark() {\n  if (process.platform !== 'darwin') {\n    throw new Error('The production watchdog is macOS-only; run this benchmark on macOS')\n  }\n  if (!existsSync(entryPath)) {\n    throw new Error(`Missing ${entryPath}; run pnpm exec electron-vite build first`)\n  }\n  const options = parseArgs(process.argv.slice(2))\n  const builtEntry = readFileSync(entryPath, 'utf8')\n  const hasChildContract = builtEntry.includes('ORCA_HANG_WATCHDOG_PARENT_PID')\n  const hasWorkerContract = builtEntry.includes('workerData') && builtEntry.includes('parentPort')\n  if (\n    (options.boundary === 'child' && !hasChildContract) ||","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/hang-watchdog-memory-benchmark.mjs#L336-L372","documentation":"Thrown by runTrial when Electron exited status 0 but no line beginning with RESULT_PREFIX was found in stdout, AND either this is the last attempt (MAX_LAUNCH_ATTEMPTS) or there is stderr/stdout noise. The benchmark relies on runInternal printing `ORCA_HANG_WATCHDOG_BENCH_RESULT=<json>`; its absence means the measurement path completed silently or was redirected.","triggerScenarios":"runInternal finished without writing the result line (early return, swallowed exception inside app.whenReady), stdout was captured/redirected away from the parent, or the result JSON threw during JSON.stringify. The presence of any stderr/stdout forces the throw immediately even on non-final attempts.","commonSituations":"A bug in runInternal that returns without writing the result, console.log noise from the watchdog under test polluting stdout before the result line and tripping the stderr/stdout condition, or a buffering issue truncating stdout.","solutions":["Inspect the captured stdout/stderr quoted in a sibling run (the [68] error path also surfaces them).","Ensure the watchdog under test does not write to stdout — it should use IPC/markers only.","Rebuild the entry and re-run; a stale build can behave inconsistently.","If noise is the cause, suppress non-result stdout in the launcher."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure the watchdog under test does not write to stdout, which can trip the noise condition\n// (validate at build time, not runtime)","typeGuard":null,"tryCatchPattern":"try {\n  const result = runTrial(executable, boundary)\n} catch (error) {\n  if (/did not report a result/.test(error.message)) {\n    // Inspect launcher stdout/stderr manually; suppress non-result output from the watchdog\n    console.error('No RESULT line printed — check for stdout pollution or an early return in runInternal')\n  }\n  throw error\n}","preventionTips":["Keep the watchdog under test from writing to stdout — use IPC and marker files only.","Ensure runInternal always reaches the RESULT_PREFIX write in its try block."],"tags":["benchmark","electron","spawn","result-parsing","watchdog"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}