Skip to content

Wait for the filtered results instead of counting after a pause - #391

Merged
adamjohnwright merged 2 commits into
mainfrom
fix/321-analysis-filter-race
Oct 10, 2026
Merged

adamjohnwright merged 2 commits into
mainfrom
fix/321-analysis-filter-race

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Refs #321 (the analysis-results filter race).

a filter changes the result set slept 150 ms after each slider step and 2 s after closing the menu, then counted the rows once. The test now waits for the slider value (toHaveValue('0')) and polls the row count, so a slow re-render can't outrun it. That also removes about 3 s of sleeps.

Honestly, this is hardening rather than a fix: I couldn't make the old test fail. The table re-filters on each key press, so it's already up to date before the menu closes. I tried throttling the CPU 20× and 60× (via CDP) and the old version still passed.

The assertion still catches a broken filter. With the FDR filter turned into a no-op, the test fails with "a stricter FDR keeps fewer pathways — Expected: < 80, Received: 80". All 11 analysis-results tests pass on 3 consecutive runs.

Also from #321: the "preflight runs unit tests before build:libs" item is already fixed. scripts/preflight.sh builds the libraries (line 93) before npm test (line 97).

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits October 10, 2026 02:03
The analysis-results filter test slept 150ms per slider step and 2s after
closing the menu, then counted the rows once. #321 listed it as a race.
It does not fail in practice -- the table re-filters on each key press,
and it passed with the CPU throttled 20x and 60x -- so this is hardening:
the slider value and the row count are now waited for, which cannot be
outrun and drops ~3s of sleeps.

The assertion still catches a broken filter: with the FDR filter made a
no-op it fails, 'Expected: < 80, Received: 80'.

Refs #321

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #391: the row locator also matched each pathway's hidden
found-entities row, and the table shows 20 a page, so the count topped
out at 40 and 'more than 20' meant 'more than 10 pathways'. A stricter
FDR that still left 20 or more would have timed out. The paginator's
total ('1 - 20 of 1057') counts the pathways themselves.

With the FDR filter made a no-op it fails: 'Expected: < 1057, Received:
1057'. All 11 analysis-results tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 6f43bff into main Oct 10, 2026
6 checks passed
@adamjohnwright
adamjohnwright deleted the fix/321-analysis-filter-race branch October 10, 2026 02:47
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