Skip to content

fix(test): stabilize flaky useReplaysFromIssue assertion test#111899

Merged
JoshuaKGoldberg merged 1 commit intomasterfrom
fix/flaky-use-replays-from-issue-spec
Apr 7, 2026
Merged

fix(test): stabilize flaky useReplaysFromIssue assertion test#111899
JoshuaKGoldberg merged 1 commit intomasterfrom
fix/flaky-use-replays-from-issue-spec

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Mar 31, 2026

Removes synchronous initial-state assertions (isFetching: true) from useReplaysFromIssue hook tests. These assertions are flaky because renderHookWithProviders uses act() internally, which flushes effects. Since MockApiClient resolves synchronously, the hook's useEffectfetchReplayIds()setReplayIds() chain can complete within the same act() boundary, leaving the hook already resolved by the time the synchronous assertion runs.

The waitFor assertions that check the final resolved state remain. I think they're enough to verify the hook's behavior.
(I actually think and wrote that, not Cursor)

Fixes ENG-7207

Made with Cursor

@JoshuaKGoldberg JoshuaKGoldberg added Scope: Frontend Automatically applied to PRs that change frontend components Frontend: Rerun Flaky Tests Known flaky tests should be run many times, just to be safe. labels Mar 31, 2026
@JoshuaKGoldberg JoshuaKGoldberg changed the title fix(test): Fix flaky useReplaysFromIssue assertion test fix(test): stabilize flaky useReplaysFromIssue assertion test Mar 31, 2026
@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 31, 2026

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review March 31, 2026 17:40
@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team as a code owner March 31, 2026 17:40
@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team March 31, 2026 17:40
@JoshuaKGoldberg JoshuaKGoldberg requested review from a team as code owners April 7, 2026 14:06
@JoshuaKGoldberg JoshuaKGoldberg requested review from a team as code owners April 7, 2026 14:06
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@sentry
Copy link
Copy Markdown
Contributor

sentry bot commented Apr 7, 2026

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 12937434

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft April 7, 2026 14:09
@JoshuaKGoldberg JoshuaKGoldberg changed the base branch from fix/flaky-test-rerun-infra to master April 7, 2026 14:09
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the fix/flaky-use-replays-from-issue-spec branch from 5db937c to 67728af Compare April 7, 2026 14:13
@JoshuaKGoldberg JoshuaKGoldberg removed the Scope: Backend Automatically applied to PRs that change backend components label Apr 7, 2026
@JoshuaKGoldberg JoshuaKGoldberg removed request for a team April 7, 2026 14:17
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.

2 participants