Skip to content

test(server): wait for PTY readiness conditions - #334

Merged
Rinat S (rsolmano) merged 7 commits into
mainfrom
verify-issue-290
Aug 31, 2026
Merged

test(server): wait for PTY readiness conditions#334
Rinat S (rsolmano) merged 7 commits into
mainfrom
verify-issue-290

Conversation

@danyaberezun

Copy link
Copy Markdown
Collaborator

Summary

  • Replace elapsed-time assumptions in terminal replay and natural-exit tests with observed PTY output/exit readiness.
  • Reproduce and cover the slow-login-shell race without changing production terminal behavior or APIs.

Closes #290

Changes

  • Add a bounded, history-aware waiter around the existing injected terminal publisher.
  • Match output across all terminal.data batches for the expected terminal id and wait for the matching terminal.exit before reattach/persistence assertions.
  • Build marker commands so their expected output is not present contiguously in echoed input, preventing PTY echo from impersonating command execution.
  • Migrate the two reported replay cases, the reported natural-exit case, and its restart-survival duplicate; document the invariant in the terminal module spec.
  • Leave unrelated busy-process and ownership test timers out of scope.

Testing

  • bun run check:deps — passed.
  • bun run check:seams — passed.
  • bun run lint — passed with six pre-existing unused-suppression warnings outside this diff.
  • bun run typecheck — 11/11 tasks passed.
  • bun run test — 11/11 tasks passed; server 846/846 tests passed.
  • SHELL=/usr/bin/bash bun test packages/server/src/terminal/terminalManager.test.ts --rerun-each=3 — 78/78 passed.
  • SHELL=/usr/bin/zsh bun test packages/server/src/terminal/terminalManager.test.ts --rerun-each=5 — 130/130 passed under concurrent verification load.
  • Four target cases with an injected two-second zsh startup delay, --rerun-each=3 — 12/12 passed.
  • An 18-second startup-delay probe failed at the bounded 15-second deadline with the missing condition and terminal id.
  • bun run e2e — 298/298 passed before the final timeout-only hardening commit; not rerun on the final head locally, with current-head coverage left to CI.

ThinkRail-Todo: 01a044f6-279b-75c3-a440-a55eb3615acc/t_453990950ca1
ThinkRail-Todo: 01a044f6-279b-75c3-a440-a55eb3615acc/t_3d9e112ad362
ThinkRail-Todo: 01a044f6-279b-75c3-a440-a55eb3615acc/t_7fce3d1f998e
ThinkRail-Todo: 01a044f6-279b-75c3-a440-a55eb3615acc/t_3d9e112ad362

@jetbrains-air jetbrains-air 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.

Approved — ready to merge.

@jetbrains-air jetbrains-air 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.

Approved — ready to merge.

@rsolmano
Rinat S (rsolmano) enabled auto-merge (squash) August 28, 2026 16:22

@jetbrains-air jetbrains-air 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.

Approved — ready to merge.

@jetbrains-air jetbrains-air 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.

Approved — ready to merge.

@rsolmano
Rinat S (rsolmano) merged commit 87ad1fc into main Aug 31, 2026
6 checks passed
@rsolmano
Rinat S (rsolmano) deleted the verify-issue-290 branch August 31, 2026 15:44
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.

Make PTY tests wait for shell readiness instead of fixed sleeps

2 participants