Skip to content

[Observation] terminal-find's failure message blames the find bar for startup-race input #347

Description

@Bidthedog

Labels

  • At least one area:* label added — area:terminal and area:infra.

What happened (observed outcome)

packages/ui/tests/e2e/terminal-find.e2e.ts:147"finds in the scrollback, counts and steps
matches — and types nothing at the shell"
— failed and passed on retry inside a full npm run gate
on master, which the strict flake gate correctly turned into a red run (353 passed, 1 flaky).

Error: expect(locator).not.toContainText(expected) failed
Expected substring: not "is not recognized"
  > 178 |       await expect(term).not.toContainText('is not recognized');

The failure message blames the find bar, and the find bar is innocent

This is the part worth acting on, separately from the flake itself.

Read the captured buffer in order:

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
C:\…\throng-tfind-bIGj75>t't' is not recognized as an internal or external command,…
C:\…\throng-tfind-bIGj75>echo NEEDLE_A
NEEDLE_A
C:\…\throng-tfind-bIGj75>echo other
…

The stray t — and a run of 32 Vs before the first prompt — arrive before echo NEEDLE_A,
which is the test's own first command and runs long before the find bar is ever opened. So whatever
typed that t did so during app/terminal startup. It is not find-bar leakage.

The assertion cannot tell, because it is scoped to the whole terminal buffer:

await expect(term).not.toContainText('is not recognized');

Anything that ever reached the prompt fails it, and the failure then reads as "searching typed at
the shell"
(SC-002) — the one thing the test exists to prove, and the one thing this run does not
show. A reader who trusts the message goes looking in the find/reserve-key path, which is clean.

Suggested fix, and it is not just a bigger timeout: scope the assertion to output produced after
the find interaction — e.g. capture the buffer immediately before find-close, and assert only on
the delta — or use a unique token per phase, the way docs/testing.md already recommends for
terminal work. That way startup noise cannot be attributed to the find bar.

What you expected (intended outcome)

The spec passes on the first attempt in a full gate run, and when it does fail, the message names
what actually went wrong.

Steps to reproduce

Load-dependent, and it does not reproduce in isolation:

Condition Result
Inside a full npm run gate on master (serial tier, ~17 min of continuous E2E) 1 flaky — failed, passed on retry
Alone on the same master, --repeat-each=6, THRONG_E2E_RETRIES=0, --workers=1 6 passed (39.8s)

The spec is already in the serial tier (parallel-plan.json, mechanism CPU) because it makes a
shell do real work, so this is the documented starvation shape rather than a defect in the product.

Environment

  • OS / version: Windows 11
  • throng branch or commit: master @ e6460d10
  • Elevated (admin) run? No

Evidence

It is not the #290 work that just landed

Worth stating explicitly, because this was the first full gate on master after PRs #343 and #346
merged. The same test, same line, in every full gate run available:

Run Contains the #290 fix terminal-find.e2e.ts:147
#343 branch gate no ok
#343 branch gate (2nd) no ok
#346 branch gate yes ok
#346 branch gate (2nd) yes ok
master, after both merged yes failed, passed on retry

Four full-suite passes, two of them with the fix present, plus 6/6 standalone afterwards. Nothing in
that change touches this path: it alters what a rebuilt view believes about the kitty negotiation,
and cmd never negotiates kitty, so programOwnsKeyboard is false here either way.

Related

Maintainer agreement

  • Agreed by maintainer. Contributor may proceed with a fix (full lifecycle unless trivially small).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:infraBuild, CI, packaging, linting, testsarea:terminalTerminal panels, PTY, shellsunder-observationSeen here but not reproducible on demand; watched and evidenced until it can be driven

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions