Skip to content

test: fail the runtime capture fast with phase attribution instead of an opaque timeout - #37

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
sweep/post-35-validation
Aug 29, 2026
Merged

test: fail the runtime capture fast with phase attribution instead of an opaque timeout#37
ScriptedAlchemy merged 2 commits into
mainfrom
sweep/post-35-validation

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • Root-causes the Verify (Node 24) failure on the fix: stop watched-file write races in e2e suites and host message drops in the Runtime App relay #35 merge commit (run 33266629560): runtime-playground-capture.test.ts hit its 600s budget with no output at all, because the capture child process has bounded browser waits but no overall deadline, and its cleanup path (restore/browser.close/fixture.close) is unbounded — any wedge is an opaque outer-test timeout.
  • Adds an in-process 480s watchdog (unref'd, main-module only) that exits 1 with the current capture phase on stderr, so the calling test's execFile rejects with attribution well inside its budget.
  • Adds phase markers across the capture stages and bounds each cleanup step at 30s (recorded as a failed step instead of holding the process open), with the step budget injectable through the existing cleanup-boundary test seam.

Test plan

  • pnpm lint, pnpm typecheck
  • Capture test file (all 3 tests, incl. full browser capture and the new wedged-cleanup-step test) green locally
  • CI green

… an opaque timeout

The runtime-playground capture child process had bounded browser waits but
no overall deadline and an unbounded cleanup path, so any wedge (fixture
start, a stuck retry loop, a hung dev-server close) surfaced as the calling
test's 600s rstest timeout with zero child output - exactly what the
Verify (Node 24) failure on the #35 merge commit showed. Add an in-process
480s watchdog that exits with the current capture phase on stderr, phase
markers across the capture stages, and a 30s bound per cleanup step so a
wedged close records a failed step instead of holding the process open.
@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c48a8c8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T19:13:54.681162Z af2518b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@37
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/rsc-runtime@37

commit: c48a8c8

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af2518bdaa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +660 to +661
process.stderr.write(`Capture watchdog: run exceeded ${captureDeadline}ms during phase ${currentPhase}.\n`);
process.exit(1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Await the watchdog diagnostic before forcing exit

When the watchdog fires under the Linux test runner, stderr is captured through execFile's pipe, so process.stderr.write() may still be pending when the immediate process.exit(1) terminates the process. This can discard the phase message and defeat the change's diagnostic attribution; exit from the write callback or otherwise wait for the stream to flush before forcing termination.

Useful? React with 👍 / 👎.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Coordination note from the sibling session: #36 just landed the same script hardening (watchdog with phase attribution, bounded cleanup steps, forced exit) for the main CI failure. The unit test here for the bounded cleanup is the piece #36 lacks — worth rebasing this PR down to the test (adapting to the merged implementation, which reads the step budget from a module constant rather than an injected parameter — an injectable parameter like this version has is arguably better for testability, so keeping your signature and adjusting the merged script would also work).

# Conflicts:
#	packages/workbench/scripts/capture-runtime-playground.mjs
@ScriptedAlchemy
ScriptedAlchemy merged commit 0ac7ca7 into main Aug 29, 2026
15 of 16 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the sweep/post-35-validation branch August 29, 2026 20:04
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