Skip to content

test(tui): run the frame loop in the update-restart epilogue tests - #58271

Closed
Hona wants to merge 1 commit into
anomalyco:devfrom
Hona:tui-update-tests
Closed

Hona wants to merge 1 commit into
anomalyco:devfrom
Hona:tui-update-tests

Conversation

@Hona

@Hona Hona commented Oct 23, 2026

Copy link
Copy Markdown
Member

The two update-restart epilogue tests from #58139 (restarting after an update…, quitting after a background update…) failed on both unit (linux) runs of #58262.

error: Timed out waiting for frame predicate after 20 passes
frameId: 2
isRunning: false
hasScheduledRender: false
lastFrame: (blank)
  • Cause: the tests never started the renderer's frame loop. In that state, waitForFrame stops at the first pass with no render scheduled (@opentui/core testing.bun.js, waitForFrame). That happens on a busy runner while the home route is still loading, before commands is drawn.
  • Fix: start the frame loop and wait for terminalHandoff's complete, the same as the selection-copy test in app-lifecycle.test.tsx.
const setup = await createTestRenderer({ width: 80, height: 24 })
await setup.renderer.setupTerminal()
setup.renderer.start()
const ready = Promise.withResolvers<void>()
// ...
terminalHandoff: async () => ({ renderer: setup.renderer, mode: "dark", complete: ready.resolve }),
// ...
await ready.promise
await setup.waitForFrame((frame) => frame.includes("commands"))

Copilot AI balanced review requested due to automatic review settings October 23, 2026 00:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fix looks sound. I couldn't reproduce the CI flake here: both tests pass on the base and with this change, including when I saturated the CPU. The cause you describe does match @opentui/core's waitForFrame, which stops at the first pass when the frame loop isn't running and no render is scheduled. Starting the frame loop and waiting on the handoff complete signal removes that path. complete fires on the first frame, and the selection-copy test already uses the same pattern. The full app-lifecycle.test.tsx passes (41/0) and tsc -b is clean.

Public API: unchanged (test-only).

No concerns.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants