Repository navigation
test(useAnnounceRenderedText): the Tokenizer adopter loads the on-demand sheet module before its one-second wait - #8896
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Recommended for approval: awaiting Tokenizer's sheet module before the case opens the sheet keeps the one-second wait on the open alone, and no product code changes. With the module's load made CPU-bound, the Tokenizer case fails on main with the reported "Search Tags" error and passes with this change, and it still fails if the sheet stops handing its content to the shared announcement module. No changes are needed.
[Automated review]
…and sheet module before its one-second wait Tokenizer loads its touch sheet on demand (loadTokenizerBottomSheet), and the adopter test's sheet case opened it with a one-second findByLabelText, so that second covered the module's first load as well as the open. On a busy machine the load alone outlasts it: the case failed in every full core run at vitest's default worker count on a 166-core box, and passed alone. The case now awaits the sheet module before it opens the sheet, so its wait covers only the open; inside the case, the load counts against the test's 30 s budget, never the one-second wait. Red first: with the module's load costing 1.2 s of CPU (a mock that busy-waits before returning it), the case fails 3 of 3 on main with the error seen under load, and passes 3 of 3 here.
392c9ad to
4e6b38d
Compare
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: The accessibility audit did not run on this pull request. It runs after merges to Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Recommended for approval: loading Tokenizer's sheet module before the case opens the sheet keeps the one-second wait on the open alone, and no product code changes. With the module's load made CPU-bound, the Tokenizer case fails on main with the reported "Search Tags" error and passes with this change, and it still fails if the sheet stops handing its content to the shared announcement module. No changes are needed.
[Automated review]
Why
The Tokenizer case of
useAnnounceRenderedText.adopters.test.tsxfails at random on a busy machine, on pull requests that don't touch Tokenizer: "Unable to find a label with the text of: Search Tags".What led to it
Tokenizer loads its touch sheet on demand (
loadTokenizerBottomSheetinTokenizer.tsx). The case opens the sheet and waits one second, the defaultfindByLabelTextwait, for the sheet's search field, so that second covers the sheet module's first load as well as the open. The load alone takes about a second on an idle machine. With vitest's default worker count on a 166-core box (165 workers), the case failed in all three full core runs I made; with 16 workers it passed in both, and it passes alone.Options and tradeoffs
component:TokenizerPR6).Why this choice
The case checks that the sheet hands its own content to the shared announcement module, not how its code loads. It now awaits
import('../Tokenizer/TokenizerBottomSheet')before it renders. That load counts against the test's 30-second budget, never against the one-second wait. The other lazily loaded sheets and layers have the same fix open in #8642 (Selector, MultiSelector), #8352 (Item's swipe layer) and #8353 (DropdownMenu's sheet).How to check it
../Tokenizer/TokenizerBottomSheetwith a factory that busy-waits 1.2 s before returning the real module.Evidence
pnpm check:repo.setTimeoutdelay in the mock did not reproduce it: the sheet rendered before the delay ended. A busy-wait starves the event loop the way load does.Local gates at 4e6b38d: Prettier and ESLint pass on the changed file; the root build passes; the core UI suite passes, and the adopters file passes alone in 5 runs of 5; the node project passes except two process-timing cases in
packages/cli/foundation/release/cache.test.mjs, which pass when that file runs alone (34 of 34), on this head and on main.