{"record":{"id":"1a5da7ce45e61891","repo":"oven-sh/bun","slug":"path-r-status-r-statustext-1a5da7","errorCode":null,"errorMessage":"${path}: ${r.status} ${r.statusText}","messagePattern":"\\$\\{path\\}: \\$\\{r\\.status\\} \\$\\{r\\.statusText\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/update-test-durations.mjs","lineNumber":59,"sourceCode":"  default: \"linux-x64-debian-13-test-bun\",\n  asan: \"linux-x64-asan-debian-13-test-bun\",\n  musl: \"linux-x64-musl-alpine-323-test-bun\",\n  windows: \"windows-x64-2019-test-bun\",\n};\n\nconst api = async path => {\n  for (let attempt = 0; ; attempt++) {\n    const r = await fetch(`https://api.buildkite.com/v2/organizations/${opts.org}/pipelines/${opts.pipeline}/${path}`, {\n      headers: { Authorization: `Bearer ${token}` },\n      signal: AbortSignal.timeout(60_000),\n    });\n    if (r.ok) return r;\n    if ((r.status === 429 || r.status >= 500) && attempt < 5) {\n      const backoff = Number(r.headers.get(\"retry-after\")) * 1000 || 1000 * 2 ** attempt;\n      await new Promise(resolve => setTimeout(resolve, backoff));\n      continue;\n    }\n    throw new Error(`${path}: ${r.status} ${r.statusText}`);\n  }\n};\n\n// Per-file cost is the gap between the APC timestamps Buildkite injects into\n// consecutive `[N/M] <path>` headers (ESC `_bk;t=<ms>` BEL). Serial tests\n// prefix the header with `--- `; the parallel-safe phase (runner.node.mjs)\n// prints the bare form. For that concurrent phase the gap is an inter-dispatch\n// delta, not wall clock; we clamp it so the last-dispatched file on each shard\n// does not absorb the N-wide tail drain or a sibling's 5-15 s retry backoff.\nfunction parseLog(raw) {\n  const out = [];\n  const lines = raw.replace(/\\x1b\\[[0-9;]*m/g, \"\").split(/\\r?\\n/);\n  let path = null;\n  let start = null;\n  let concurrent = false;\n  const emit = ts => {\n    if (path === null || start === null || ts === null) return;\n    out.push([path, concurrent ? Math.min(ts - start, 500) : ts - start]);","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/update-test-durations.mjs#L41-L77","documentation":"Error \"${path}: ${r.status} ${r.statusText}\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at scripts/update-test-durations.mjs:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}