Skip to content

fix(client): wait for toast to clear before re-checking identical Mongo replica-set error#41963

Open
wyattwalter wants to merge 1 commit into
releasefrom
fix/mongo-connection-errors-toast-dedup-flake
Open

fix(client): wait for toast to clear before re-checking identical Mongo replica-set error#41963
wyattwalter wants to merge 1 commit into
releasefrom
fix/mongo-connection-errors-toast-dedup-flake

Conversation

@wyattwalter

@wyattwalter wyattwalter commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

ConnectionErrors_Spec.ts's "3. Mongo connection errors" test asserts the exact same toast message twice in a row (REPLICA_SET connections should not be given a port...) — once right after switching Connection type to "Replica set", and again right after filling in host/port. Every other repeated-message check in this same spec calls WaitUntilAllToastsDisappear() in between; this one didn't.

Toastify doesn't reliably mount a new DOM node for an identical message while the previous instance is still visible/fading, so the second ValidateToastMessage call can time out waiting for div.Toastify__toast — intermittently, depending on exact timing. This caused a real CI failure on an unrelated release-promotion PR (EE #9268 / CE #41961), reproduced consistently across 3 retries in that run.

Fix: add the same WaitUntilAllToastsDisappear() call used elsewhere in this spec before the second identical-message check.

Root cause detail

From the failing run's logs: the backend correctly returned the TEST_DATASOURCE_ERROR action with the replica-set-port error message both times (confirmed via the intercepted @testDatasource XHR), so this is a test-timing issue, not a backend regression.

Test plan

  • ConnectionErrors_Spec.ts passes reliably in CI (no test-plugin infra changes required, so no server-side test coverage needed)

Summary by CodeRabbit

  • Tests
    • Improved regression coverage for MongoDB connection error handling.
    • Added a wait for error notifications to clear before continuing through the rest of the validation flow, making the test more reliable.

…go replica-set error

ConnectionErrors_Spec.ts asserted the same "REPLICA_SET connections
should not be given a port" toast twice in a row without waiting for
the first one to disappear. Toastify doesn't reliably mount a second
DOM node for an identical message while the prior one is still
visible/fading, causing an intermittent 60s timeout on the second
assertion. Add the same WaitUntilAllToastsDisappear() call already
used elsewhere in this spec before repeated identical-message checks.
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 174ba739-1edf-4ebb-b4c9-f224b5fff35d

📥 Commits

Reviewing files that changed from the base of the PR and between 48ac053 and 92c2157.

📒 Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts

Walkthrough

A single-line change adds a wait for all toast notifications to disappear after a specific error assertion in the MongoDB connection errors Cypress test, before proceeding with subsequent test steps.

Changes

Test synchronization fix

Layer / File(s) Summary
Add toast wait in Mongo connection test
app/client/cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts
Adds agHelper.WaitUntilAllToastsDisappear() after the REPLICA_SET port error toast validation to ensure toasts clear before subsequent field-clearing steps.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A toast pops up, then fades from sight,
The test now waits till all is right. 🐰
One line added, calm restored,
No flaky runs to be deplored.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the actual fix: waiting for the toast to clear before retrying the same Mongo replica-set error check.
Description check ✅ Passed The description includes motivation, root cause, fix, and test plan; only optional template sections like issue link and communication are missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mongo-connection-errors-toast-dedup-flake

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant