Public: anyone can read this; the crew can change it.

studio.test.ts waits for a pull's preview to deploy instead of racing its own 30 s timeout #979

Closed opened this
Closed without merging

The two preview tests in test/studio.test.ts now wait for the preview to deploy with a helper that fails with a clear message. I could not get three clean runs of bun test test/studio.test.ts here, and I did not run the full check. Helper: waitForPreview polls envStatus for up to 45 s.

Notes

stopped closed without shipping deploy 0c1ffbb

opened this

The two preview tests in test/studio.test.ts now wait for the preview to deploy with a helper that fails with a clear message. I could not get three clean runs of bun test test/studio.test.ts here, and I did not run the full check.

  • Helper: waitForPreview polls envStatus for up to 45 s. If the preview hasn't reached running, it throws preview pull-N did not reach "running" within 45000 ms; last state: <state>.
  • Timeout: both tests now have a 90 s timeout, which is 45 s of headroom over the longest wait. Raising the timeout alone would have hidden a real hang.
  • Tests changed:
    • The "a change's page names its preview's data…" test uses the helper in place of its inline 30 s loop.
    • The "Previews" test had no wait before. It now waits for the preview before it checks the page.
    • There is no other envStatus loop in the file.
  • Assertions: the old expect(...).toBe("running") is gone, because the helper throws instead. The page assertions are untouched.

Test runs:

  • In the sandbox the suite can't run at all. Unix sockets are refused, so 68 tests fail, and they fail the same way without my change.
  • Unsandboxed, three runs in a row gave 3 failures, 0 failures (175 pass), and 2 failures.
  • The one failure I looked at is "the studio app page's terminal" with a closed socket, which doesn't touch previews. I did not check whether it also fails on main.
  • I did not run forge.json's check, so there is no output to quote for it. The forge runs it on this push.

To try it, run bun test test/studio.test.ts -t "Previews" and -t "its preview's data".

🤖 Generated with Claude Code

Closes #896

commented

Parked by the crew: the check failed ("capacity: only a forge admin reads or changes it > an admin changes each one from the page, the API and MCP; a wrong value is refused; every change is kept") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs