Skip to content

test(pty): wait for settled interactive frames - #680

Open
benvinegar wants to merge 2 commits into
mainfrom
fix/main-ci-pty-races
Open

test(pty): wait for settled interactive frames#680
benvinegar wants to merge 2 commits into
mainfrom
fix/main-ci-pty-races

Conversation

@benvinegar

@benvinegar benvinegar commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary

  • sample PTY snapshots only after a quiet period so resize tests do not accept partially painted frames
  • prove keyboard readiness before filter tests type shortcut-bearing text
  • make the keyboard probe retry only startup misses while surfacing failures to close the help overlay
  • strengthen the split-resize predicate around the final row content it asserts
  • await a workspace-write reload before test teardown so Windows can remove the temporary checkout

Why

Two consecutive main runs failed in different PTY tests. One sent Tab before keyboard subscription, causing the t in beta to open the theme selector. The other accepted a transitional resize frame before the expected row text finished painting. A rerun of unchanged main passed, confirming timing races rather than a product regression.

After rebasing onto the latest main, Windows exposed another synchronization issue: a workspace test deleted its temporary checkout while the successful-write reload still had a Git child process using it. The test now waits for the reloaded content, which is the actual completion condition it should assert.

Validation

  • affected filter tests: 20 repeated runs on Bun 1.3.14, all passed
  • explicit split-resize test: 20 repeated runs on Bun 1.3.14, all passed
  • workspace integration test: 20 repeated runs with no late Git reads or cleanup errors
  • hosted Windows compatibility job: passed after the readiness fix
  • full PTY suite on Bun 1.3.14: 96 passed
  • CI-equivalent unit/session suite on Bun 1.3.14: 1,882 passed, 9 skipped
  • bun run format:check
  • bun run lint
  • bun run typecheck

This PR description was generated by Pi using OpenAI GPT-5.6

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hunk-web Ready Ready Preview Aug 6, 2026 3:37pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR hardens PTY tests against startup and partial-paint timing races.

  • Waits for a quiet period before evaluating interactive snapshots.
  • Probes keyboard readiness before sending filter shortcuts.
  • Retries only startup misses while surfacing failures to close the help overlay.
  • Strengthens the split-resize assertion to require its final row content.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code defect identified.

The synchronization changes preserve adequate polling budgets, deliberately distinguish startup retries from overlay-close failures, and strengthen assertions without changing production behavior.

Important Files Changed

Filename Overview
test/pty/harness.ts Updates snapshot sampling to evaluate settled frames and narrows keyboard-probe retries to startup failures.
test/pty/chrome.test.ts Adds keyboard-readiness checks before shortcut-sensitive filter interactions.
test/pty/filter-escape.test.ts Ensures keyboard input is live before exercising filter opening and escape behavior.
test/pty/layout.test.ts Requires the expected final row content before accepting the resized split frame.
.changeset/cyan-taxes-live.md Adds an intentionally empty changeset for test-only changes.

Reviews (1): Last reviewed commit: "test(pty): wait for settled interactive ..." | Re-trigger Greptile

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