Skip to content

fix(test): Fix flaky EventGroupingInfo rendering test#111844

Draft
JoshuaKGoldberg wants to merge 1 commit intomasterfrom
fix/flaky-grouping-info-section-spec
Draft

fix(test): Fix flaky EventGroupingInfo rendering test#111844
JoshuaKGoldberg wants to merge 1 commit intomasterfrom
fix/flaky-grouping-info-section-spec

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

Summary

  • Fix flaky test EventGroupingInfo > fetches and renders grouping info for errors (2 occurrences in last 30 days)
  • The test clicks to expand a collapsed FoldSection, which triggers a chain of async operations: React.lazy module resolution, API fetch via useApiQuery, and React re-render. The findByText call must wait for all three to complete, which occasionally exceeded the polling window under CI load.
  • Added await waitFor(() => expect(groupingInfoRequest).toHaveBeenCalled()) after the expand click to explicitly wait for the lazy-loaded component to resolve and fire the API query before asserting on rendered text.

Test plan

  • CI=true pnpm test static/app/components/events/groupingInfo/groupingInfoSection.spec.tsx passes (all 4 tests)

Made with Cursor

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant