Skip to content

Fix flaky SkillsScreen verdict-count assertions (#2941) - #2952

Merged
cliffhall merged 2 commits into
v2/mainfrom
v2/fix/2941-skills-screen-flaky-verdicts
Nov 11, 2026
Merged

cliffhall merged 2 commits into
v2/mainfrom
v2/fix/2941-skills-screen-flaky-verdicts

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2941

What changed

findAllByText resolves as soon as at least one match exists, so expect(await screen.findAllByText(x)).toHaveLength(n) with n > 1 races the remaining matches — the failure seen on #2940's CI build job (expected [ <span> ] to have a length of 2 but got 1).

Each such pair in SkillsScreen.test.tsx now waits for the asserted condition itself:

await waitFor(() => expect(screen.getAllByText("verified")).toHaveLength(2));

That's the awaited-condition remedy #1596 prescribes, not added headroom. The issue named one test; the same shape appeared at five sites in the file (3× verified, Could not read file, plain string), and all five are converted. No production code changes.

Verification

  • SkillsScreen.test.tsx: 114/114 pass
  • npm run local:gate: green

🤖 Generated with Claude Code

…dict tests (#2941)

findAllByText resolves on the first match, so a length assertion on it races
the remaining matches. Wrap each findAllBy + toHaveLength(n > 1) pair in
waitFor over getAllBy, per #1596's awaited-condition remedy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the test-only change to wait for expected match counts.

No open issues 🎉

What changed in this PR

Fixes the SkillsScreen test race reported in #2941 by waiting for the expected number of matches, rather than asserting immediately after the first match appears.

Changes:

  • Converts five findAllByText count assertions to waitFor with getAllByText.
  • Preserves expected counts without increasing timeouts or changing production code.
File Description
clients/​web/​src/​components/​screens/​SkillsScreen/​SkillsScreen.test.tsx Waits for complete verdict and error-message counts before proceeding.

Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 1 was clean (no inline comments, no headline findings, no suppressed comments).

@cliffhall
cliffhall merged commit f915337 into v2/main Nov 11, 2026
11 checks passed
@cliffhall
cliffhall deleted the v2/fix/2941-skills-screen-flaky-verdicts branch November 11, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky web test: SkillsScreen "drops verdicts when a refresh replaces the manifest" asserts a count after findAllByText

2 participants