Skip to content

fix(crons): De-flake "prefills with an existing monitor" test#115782

Merged
priscilawebdev merged 1 commit into
masterfrom
priscilawebdev/fix/jest-22p6-tests-fix-flaky-monitorform-prefills-test
May 19, 2026
Merged

fix(crons): De-flake "prefills with an existing monitor" test#115782
priscilawebdev merged 1 commit into
masterfrom
priscilawebdev/fix/jest-22p6-tests-fix-flaky-monitorform-prefills-test

Conversation

@priscilawebdev
Copy link
Copy Markdown
Member

De-flake the prefills with an existing monitor test in monitorForm.spec.tsx.

After asserting toBeChecked() on the Crontab and Los Angeles menuitemradio options, the test re-clicked them. Each click dispatched a same-value setValue into the FormModel, which still ran validateField and updateShowSaveState and scheduled a re-render. That extra state churn was the source of the rare race where the Grace Period spinbutton briefly read 55 instead of 5 before the next assertion ran (JEST-22P6 in Sentry).

Close the menus with {Escape} instead — the same pattern this test already uses for Owner and Notify a few lines below — and remove the it.isKnownFlake wrapper now that the source of the race is gone.

Verified locally: 25/25 consecutive isolated runs of this test pass, and the full spec file passes (5/5).

Fixes JEST-22P6

The test re-clicked the already-checked Crontab and Los Angeles
menuitemradios after asserting `toBeChecked()`. Each click dispatched a
same-value `setValue` into the FormModel, which still runs
`validateField` and `updateShowSaveState` and schedules a re-render.
That extra state churn was the source of the rare race where the Grace
Period spinbutton briefly displayed `55` instead of `5` before the
assertion ran.

Close the menus with `{Escape}` instead — the same pattern this test
already uses for Owner and Notify a few lines below. Drop the
`it.isKnownFlake` wrapper now that the source of the race is gone.

Fixes JEST-22P6
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.56%

@priscilawebdev priscilawebdev marked this pull request as ready for review May 19, 2026 12:25
@priscilawebdev priscilawebdev requested a review from a team as a code owner May 19, 2026 12:25
@priscilawebdev priscilawebdev requested a review from a team May 19, 2026 12:25
@priscilawebdev priscilawebdev enabled auto-merge (squash) May 19, 2026 12:29
@priscilawebdev priscilawebdev merged commit 88be692 into master May 19, 2026
77 checks passed
@priscilawebdev priscilawebdev deleted the priscilawebdev/fix/jest-22p6-tests-fix-flaky-monitorform-prefills-test branch May 19, 2026 14:07
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