Skip to content

test(runtime): write the probe's report aside and rename it into place - #547

Merged
mrgoonie merged 12 commits into
mainfrom
fix/543-probe-report-atomic
Oct 7, 2026
Merged

mrgoonie merged 12 commits into
mainfrom
fix/543-probe-report-atomic

Conversation

@mrgoonie

@mrgoonie mrgoonie commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Refs #543 (item 1). Found while working on #497.

What changed

The probe service in apps/runtime/test/service-artifact-input.spec.ts wrote its report with writeFileSync(args.report, ...) at the path the test polls. The test reads the file as soon as existsSync is true and parses it, so it could read the file after it was created and before its bytes were in it:

FAIL  ... > answers no read once the call has ended, even one sent while it was in flight
SyntaxError: Unexpected end of JSON input
 > apps/runtime/test/service-artifact-input.spec.ts:651:23

The probe now writes <report>.partial and renames it to <report>, so the report exists only once it is complete. The fix is in the writer; the test's assertions are unchanged.

What stays the same

Product code, every assertion, and the other probe steps (signal files are only checked for existence, never read).

Verification

  • corepack pnpm vitest run apps/runtime/test/service-artifact-input.spec.ts, 5 runs in a row: 15/15 passed each time. (The race was intermittent and was not reproduced on demand before the fix either.)
  • corepack pnpm verify on this head:
    • first run: exit 1. All 13 invariant checks passed, typecheck and lint passed. Two unrelated suites failed in Windows temp-dir cleanup with EPERM (packs/browser-playwright/test/driver.spec.ts, injection.spec.ts). Both pass alone (2 files, 18 tests). Recorded on Windows: runtime suites time out under parallel verify, then fail cleanup with EPERM #535.
    • second run: exit 0. All 13 invariant checks passed; 519 test files passed, 1 skipped; 6910 tests passed, 37 skipped, 1 todo.

Known limitations / remaining

The e2e failures in #543 item 2 (seen only in the full Playwright run) are not addressed here; their causes are not yet found.

Docs impact

None (test only).

The probe service wrote its report with writeFileSync where the test polls for it, so the test could read the file after it was created and before its bytes were in it, and fail with 'Unexpected end of JSON input'.

Refs #543
@mrgoonie

mrgoonie commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at 5bc7ee0763f68125acf5a9c1f9f964697ad9f0fe, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie
mrgoonie enabled auto-merge (squash) October 6, 2026 16:24
@mrgoonie

mrgoonie commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at d2094192211f5f1b511b4ce9e9f004d13930d981, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie

mrgoonie commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at 321b916e5ffed2008d97222ea64ef7802a6d69d0, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie

mrgoonie commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at 4e373c3246b4211b7b934cea13b3fabb2028f2f9, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie

mrgoonie commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at 91218406495e0bfd0601fd7a402f63fdd626cf61, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie

mrgoonie commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at 2892642df3cf0375865a039eb08aa11474810d02, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie

mrgoonie commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at 43a385df03c98d1dbde96e682378ec1bc61c3b95, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie

mrgoonie commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at 2f07bf1629c65d5a133201ec9a2d9fe2f4c9dfd7, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@mrgoonie

mrgoonie commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at ab22b5ffd9a97adfb0d0bdaf1b467b7d48247a8d, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie

mrgoonie commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at 104754c8b911558c0d2524c35857b4d691d426fd, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie

mrgoonie commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at e33b345e866516eb424e819f1424393b3c129fe4, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie

mrgoonie commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Review attestation: ready to merge at fee64f74bf35ed7449011ebf79e8aa3e6111edf8, reviewed by agent:code-reviewer.

A push to this PR makes this attestation stale; the new head needs its own review.

@mrgoonie
mrgoonie merged commit a9268f4 into main Oct 7, 2026
37 of 41 checks passed
@mrgoonie
mrgoonie deleted the fix/543-probe-report-atomic branch October 7, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant