test(databases): stabilize flaky SQLAlchemy-form visibility assertion#41823
Conversation
The form mounts inside DatabaseModal's animated tab pane, and rc-motion's animation state in jsdom is nondeterministic: toBeVisible intermittently times out (observed on unrelated PRs' jest shards) even though the form is rendered. Assert on document presence instead, which is what the tab-switch regression check actually needs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Code Review Agent Run #4c4536Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41823 +/- ##
==========================================
- Coverage 64.74% 64.73% -0.01%
==========================================
Files 2687 2687
Lines 148747 148747
Branches 34330 34330
==========================================
- Hits 96299 96293 -6
- Misses 50681 50687 +6
Partials 1767 1767
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aminghadersohi
left a comment
There was a problem hiding this comment.
Scans N/A (single test file, no Python). Fix replaces toBeVisible() with toBeInTheDocument() for the SQLAlchemy form inputs (lines 1812/1814) — not a mask: the flake source is rc-motion's animation state in jsdom being nondeterministic for the tab pane, which is orthogonal to whether the form actually rendered. The regression being guarded ("form renders after clicking connect") is a presence question, and presence is still verified with the specific testids via the pre-existing findByTestId await. Reasonable, well-documented trade-off — no concerns.
aminghadersohi
left a comment
There was a problem hiding this comment.
approved_clean: CI fully green (all required checks pass, no pending/red); zero findings above NIT (clean, well-documented root-cause test-stabilization fix — toBeVisible → toBeInTheDocument to remove rc-motion animation nondeterminism from the assertion while still verifying the SQLAlchemy form renders); no open threads from any reviewer; trusted MEMBER author.
|
Added |
SUMMARY
Stabilizes a flaky assertion in the DatabaseModal RTL suite that has been intermittently failing jest shard 1 on unrelated PRs (bit #41776 today; passed on plain rerun of the same commit).
switches to the SQLAlchemy URI form via the connect link(from the Cypress→RTL migration, #41436) assertstoBeVisible()on inputs that mount inside the modal'sanimated={{ tabPane: true }}Tabs. rc-motion's animation state in jsdom is nondeterministic — in the bad mode the pane never reports visible and the test burns its full timeout, sowaitFor-ing visibility wouldn't help. Reproduced locally as bimodal: same tree passes or fails 3/3 depending on the run.The tab-switch regression the test guards is "the SQLAlchemy form is rendered after clicking connect," so this asserts document presence instead of animation-dependent visibility.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — test-only.
TESTING INSTRUCTIONS
npx jest src/features/databases/DatabaseModal/index.test.tsx— 82/82 pass; the previously flaky test passes 4/4 consecutive runs (previously failing 3/3 in the bad mode).ADDITIONAL INFORMATION
🤖 Generated with Claude Code