Skip to content

test(CommandPalette): the lookup-work test finds its options without a visibility check per option - #8725

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/commandpalette-perf-hidden-query
Oct 27, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/commandpalette-perf-hidden-query

Conversation

@vjeux

@vjeux vjeux commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Review only this PR's change: vjeux/astryx@ad427c2...a883bdc

Maintainer impact

CommandPalette.perf.test.ts › "bounds lookup work with 500 items" times out at its 30 s budget in loaded full runs and passes alone. It counts the reads a mouseover makes to find its option, but it found the options with getAllByRole('option'), which checks each option's visibility through jsdom's getComputedStyle, its ancestors' included: about 4.5 s per query at 500 options, twice per run, so the case took about 9 s alone.

Intended invariant

A test's time goes to what it checks; here that is the lookup's reads, a count no load changes.

Change

The option queries pass {hidden: true}, which skips the per-option visibility check; the combobox query still checks that the open palette is visible. The read-count assertion is unchanged.

Evidence

  • Failure before the change: with the test budget cut to 4 s (the 30 s budget under a sevenfold slowdown), the 500-item case timed out (it needs about 10 s there).
  • Success after the change: it passes in about 0.6 s, alone and with the 4 s budget.
  • Mutation-sensitive proof: a handler that scans the list (findIndex over the items) still fails the test at both sizes (50 and 500 reads).
  • Product/runtime behavior verified unchanged: test-only.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • CommandPalette tests: 135/135.
  • A loaded run (4 cores, 32 workers, seven component folders): the 500-item case timed out with the old queries and passed in 10.9 s with the new ones.
  • prettier, eslint, check:changesets.

…a visibility check per option

The test counts the reads a mouseover makes to find its option (at most one, at 50 and at 500 items), but it found the options with getAllByRole('option'), which checks each one's visibility through jsdom's getComputedStyle, its ancestors' included: about 4.5 s per query at 500 options, twice per run, so the case took about 9 s alone and passed its 30 s budget only without load (it timed out in loaded full runs). The option queries now pass {hidden: true}; the combobox query still checks that the open palette is visible.

The 500-item case now takes about 0.6 s. With the test budget cut to 4 s (the 30 s budget under a sevenfold slowdown), it timed out before and passes after. A handler that scans the list (findIndex over the items) still fails it at both sizes (50 and 500 reads).
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 27, 2026 6:15pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 27, 2026, 6:28 PM UTC

@astracat-bot astracat-bot 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.

This test-only change looks good to merge: passing {hidden: true} to the option queries removes the per-option visibility checks that dominated the test's runtime, and the read-count assertion still fails a lookup that scans the list, at both 50 and 500 items. No changes are needed.

[Automated review]

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 27, 2026
@cixzhang
cixzhang merged commit f3e48f1 into meta:main Oct 27, 2026
62 checks passed
@vjeux
vjeux deleted the test/commandpalette-perf-hidden-query branch October 27, 2026 20:22

This branch was successfully deployed

1 active deployment
Preview — a883bdca Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants