{"record":{"id":"520112ada3d0f316","repo":"santifer/career-ops","slug":"name-used-elapsedms-1000-tofixed-1-s-of","errorCode":null,"errorMessage":"${name} used ${(elapsedMs / 1000).toFixed(1)}s of its ${(budgetMs / 1000).toFixed(0)}s budget (${Math.round((elapsedMs / budgetMs) * 100)}%) — it is passing, but it is close to being killed for time","messagePattern":"(.+?) used (.+?)s of its (.+?)s budget \\((.+?)%\\) — it is passing, but it is close to being killed for time","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"test-all.mjs","lineNumber":479,"sourceCode":"    const result = run(NODE, [join(scriptTmp, scriptFile), ...args], {\n      cwd: scriptTmp,\n      stdio: ['pipe', 'pipe', 'pipe'],\n      ...(declared ? { timeout: timeoutMs } : {}),\n    });\n    const elapsedMs = Date.now() - startedAt;\n    // A budget a script can raise for itself is a place to hide in, unless\n    // something still notices it creeping. Nothing did: the reason\n    // tracker-writer-lock-tests.mjs was killed rather than flagged is that\n    // spending 29 of its 30 seconds looked exactly like spending 2 — the suite\n    // reported \"runs OK\" either way, right up to the run where it did not.\n    //\n    // So the ceiling is not the only signal any more. A script that eats most\n    // of its budget says so while it is still passing, which is the point at\n    // which someone can act. This is a WARNING rather than a failure on\n    // purpose: a loaded runner is a normal reason to be slow, and turning that\n    // into a red run would trade one false failure for another.\n    if (result !== null && elapsedMs > budgetMs * SLOW_SCRIPT_WARN_FRACTION) {\n      warn(`${name} used ${(elapsedMs / 1000).toFixed(1)}s of its ${(budgetMs / 1000).toFixed(0)}s budget `\n        + `(${Math.round((elapsedMs / budgetMs) * 100)}%) — it is passing, but it is close to being killed for time`);\n    }\n    if (result !== null) {\n      pass(`${name} runs OK`);\n    } else if (allowFail) {\n      warn(`${name} exited with error (expected without user data)`);\n    } else {\n      // Include the child's exit status and streams. Without them a CI-only\n      // failure arrives as a bare `<name> crashed`: no stack, no assertion\n      // text, no exit code, and nothing a reader can act on.\n      fail(`${name} crashed${formatRunFailure()}`);\n    }\n  }\n\n  // assessment-log.mjs CLI contract (#2797): help aliases print one shared\n  // usage block, unknown leading-dash arguments fail loudly, and the existing\n  // add/summary paths still accept ordinary values that merely contain dashes.\n  {","sourceCodeStart":461,"sourceCodeEnd":497,"githubUrl":"https://github.com/santifer/career-ops/blob/60398d6549a46f5266929538af21cfab94badc75/test-all.mjs#L461-L497","documentation":"test-all.mjs runs each script under a per-script time budget. When a script exits successfully but consumed more than SLOW_SCRIPT_WARN_FRACTION (0.75) of its budget, this warning fires while the test still passes. It is deliberately a warning, not a failure: a loaded runner is a normal reason to be slow. The feature exists because tracker-writer-lock-tests.mjs once spent 29 of its 30 seconds and was killed with no prior signal -- the ceiling alone hid the creep until it became a timeout.","triggerScenarios":"CI runner under parallel load; cold caches on first run; a script that is genuinely creeping toward its ceiling (the regression this catches); a script that raised its own budget and still eats most of it.","commonSituations":"Shared CI machines running several suites at once; laptops running builds concurrently; intermittent resource contention making the warning flaky.","solutions":["Re-run the suite on an idle machine: if the warning disappears, it was load, not code.","If the same named script consistently eats its budget, profile it -- that steady creep is exactly the pre-timeout regression the warning exists to surface.","Raise that script's budget only with justification; the warning still tracks raised ceilings, so hidden creep remains visible."],"exampleFix":"# before (loaded runner)\ntracker-writer-lock-tests used 26.8s of its 30s budget (89%) — it is passing, but...\n# after (idle re-run confirms it was load, not creep)\n$ node test-all.mjs   # same script now reports ~3s, no warning","handlingStrategy":"retry","validationCode":"// Distinguish load from creep: time a suspect script on an idle box before acting\nimport { execSync } from 'node:child_process';\nconst t = Date.now();\nexecSync('node tracker-writer-lock-tests.mjs', { stdio: 'ignore' });\nconsole.log(`${((Date.now() - t) / 1000).toFixed(1)}s idle-machine baseline`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-run the suite on an idle machine before treating this warning as a code regression.","Watch trends: the same script hitting 75%+ of budget across quiet runs is the pre-timeout creep the check exists to catch.","Don't silence it by reflexively raising budgets — the warning deliberately still fires against raised ceilings."],"tags":["test-all","time-budget","slow-test","ci","performance-regression"],"backgroundTag":"test-timeout","analyzedSha":"60398d6549a46f5266929538af21cfab94badc75","analyzedAt":"2026-08-20T23:00:06.764Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}