Skip to content

fix(test): stabilize flaky TimeSince timezone tooltip test#111928

Closed
JoshuaKGoldberg wants to merge 1 commit intomasterfrom
fix/flaky-time-since-spec
Closed

fix(test): stabilize flaky TimeSince timezone tooltip test#111928
JoshuaKGoldberg wants to merge 1 commit intomasterfrom
fix/flaky-time-since-spec

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Mar 31, 2026

Stabilizes the TimeSince > respects timezone in tooltip test by eliminating the tooltip open delay as a source of flakiness.

The test hovers a <time> element and asserts a tooltip containing "EST" appears. The Tooltip component has a default 50ms OPEN_DELAY that, combined with React render time under CI load, could cause the assertion to fail intermittently.

This gets around the delay by passing an explicit tooltipProps={{delay: 0}}, making the tooltip appear much more quickly.

Note that CI Jest tests are failing because the Frontend: Rerun Flaky Tests Known flaky tests should be run many times, just to be safe. label is causing other, still-flaky tests to be run.

Fixes ENG-7211

Made with Cursor

@JoshuaKGoldberg JoshuaKGoldberg added the Frontend: Rerun Flaky Tests Known flaky tests should be run many times, just to be safe. label Mar 31, 2026
@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 31, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 31, 2026
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the fix/flaky-time-since-spec branch from 30ff8c6 to 6b2cd3d Compare March 31, 2026 19:17
await waitFor(() => {
expect(screen.getByText(/EST/)).toBeInTheDocument();
});
expect(await screen.findByText(/EST/)).toBeInTheDocument();
Copy link
Copy Markdown
Member Author

@JoshuaKGoldberg JoshuaKGoldberg Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Explanation] Cursor made this change. They're roughly equivalent, so I do prefer the updated version for simplicity.

For fun, I had Cursor also whip up a lint rule to enforce this: #111990

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review April 1, 2026 12:33
@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team April 1, 2026 12:33
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the fix/flaky-time-since-spec branch from 6b2cd3d to 9269297 Compare April 2, 2026 14:08
@JoshuaKGoldberg JoshuaKGoldberg requested review from a team as code owners April 2, 2026 14:08
@JoshuaKGoldberg JoshuaKGoldberg removed request for a team April 2, 2026 14:08
Increase waitFor timeout to 3000ms for the tooltip text assertion.
The tooltip has a render delay that can exceed waitFor's default
1000ms timeout under CI load.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Made-with: Cursor
@JoshuaKGoldberg
Copy link
Copy Markdown
Member Author

Ok this isn't fair. I rebased off master and retargeted the branch. There's no reason why it should have requested everyone for review. 😩

image

@JoshuaKGoldberg
Copy link
Copy Markdown
Member Author

Superseded by #112196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend: Rerun Flaky Tests Known flaky tests should be run many times, just to be safe. Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants