santifer/career-ops · warning

${name} used ${(elapsedMs / 1000).toFixed(1)}s of its ${(bud

Error message

${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

What it means

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.

Source

Thrown at test-all.mjs:479

    const result = run(NODE, [join(scriptTmp, scriptFile), ...args], {
      cwd: scriptTmp,
      stdio: ['pipe', 'pipe', 'pipe'],
      ...(declared ? { timeout: timeoutMs } : {}),
    });
    const elapsedMs = Date.now() - startedAt;
    // A budget a script can raise for itself is a place to hide in, unless
    // something still notices it creeping. Nothing did: the reason
    // tracker-writer-lock-tests.mjs was killed rather than flagged is that
    // spending 29 of its 30 seconds looked exactly like spending 2 — the suite
    // reported "runs OK" either way, right up to the run where it did not.
    //
    // So the ceiling is not the only signal any more. A script that eats most
    // of its budget says so while it is still passing, which is the point at
    // which someone can act. This is a WARNING rather than a failure on
    // purpose: a loaded runner is a normal reason to be slow, and turning that
    // into a red run would trade one false failure for another.
    if (result !== null && elapsedMs > budgetMs * SLOW_SCRIPT_WARN_FRACTION) {
      warn(`${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`);
    }
    if (result !== null) {
      pass(`${name} runs OK`);
    } else if (allowFail) {
      warn(`${name} exited with error (expected without user data)`);
    } else {
      // Include the child's exit status and streams. Without them a CI-only
      // failure arrives as a bare `<name> crashed`: no stack, no assertion
      // text, no exit code, and nothing a reader can act on.
      fail(`${name} crashed${formatRunFailure()}`);
    }
  }

  // assessment-log.mjs CLI contract (#2797): help aliases print one shared
  // usage block, unknown leading-dash arguments fail loudly, and the existing
  // add/summary paths still accept ordinary values that merely contain dashes.
  {

View on GitHub (pinned to 60398d6549)

Solutions

  1. Re-run the suite on an idle machine: if the warning disappears, it was load, not code.
  2. 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.
  3. Raise that script's budget only with justification; the warning still tracks raised ceilings, so hidden creep remains visible.

Example fix

# before (loaded runner)
tracker-writer-lock-tests used 26.8s of its 30s budget (89%) — it is passing, but...
# after (idle re-run confirms it was load, not creep)
$ node test-all.mjs   # same script now reports ~3s, no warning
Defensive patterns

Strategy: retry

Validate before calling

// Distinguish load from creep: time a suspect script on an idle box before acting
import { execSync } from 'node:child_process';
const t = Date.now();
execSync('node tracker-writer-lock-tests.mjs', { stdio: 'ignore' });
console.log(`${((Date.now() - t) / 1000).toFixed(1)}s idle-machine baseline`);

Prevention

When it happens

Trigger: 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.

Common situations: Shared CI machines running several suites at once; laptops running builds concurrently; intermittent resource contention making the warning flaky.

Related errors


AI-assisted analysis of santifer/career-ops@60398d6549 (2026-08-20). Data as JSON: /api/errors/520112ada3d0f316. Report an issue: GitHub.