fix(test): stop cy.log in the Cypress fail listener masking real errors - #42112
Open
wyattwalter wants to merge 1 commit into
Open
fix(test): stop cy.log in the Cypress fail listener masking real errors#42112wyattwalter wants to merge 1 commit into
wyattwalter wants to merge 1 commit into
Conversation
Cypress.on("fail") runs outside the Cypress command queue. Calling cy.log
there raises a second CypressError ("returned a promise from a command while
also invoking one or more cy commands"), which replaces the original failure
in the job log and the mochawesome report.
Log outside the queue instead, and keep the rethrow.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Cypress failure handler now uses synchronous ChangesCypress failure handling
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
wyattwalter
marked this pull request as ready for review
August 11, 2026 13:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
app/client/cypress/support/e2e.jsregisters aCypress.on("fail")listener that callscy.log(error.message).Event listeners run outside the Cypress command queue, so enqueuing a
cy.*command there makes Cypress raise a second error:That second error is what lands in the job log and the mochawesome report, so the real assertion failure is replaced by a message about promises. This is the same bug class as #42069 (
cy.loginside acy.interceptresponse handler); that PR fixed the intercept instance and this is the remaining one — the completeness check missed it because the call site is an event listener rather than an intercept handler.The fix logs outside the command queue and keeps the rethrow, matching the pattern #42069 established.
This does not make any failing spec pass. It stops failing specs from being misreported, which is what makes them hard to triage.
Evidence
Mined from the 12 most recent
test-build-docker-image.ymlscheduled runs onappsmithorg/appsmith-ee, 2026-08-06 through 2026-08-11 (all post-#42069, so the intercept instance is already fixed):EE/Enterprise/MultipleEnv/ME_CustomEnv_spec.ts,EE/Enterprise/SettingsPane/BrandingBuisness_Settings_spec.ts,EE/Enterprise/AuditLogs/Audit_logs_EEAccess_spec.js,EE/Enterprise/RBAC/RBACUITests/Users_spec.js,Regression/ClientSide/Widgets/Input/InputRTL_support.ts.BrandingBuisness_Settings_spec.ts: the real failure is a toast assertion (AggregateHelper.ValidateToastMessage->GetNAssertContains->GetElement). What the report shows instead is the promise CypressError.before allhook, the log readsBecause this error occurred during a 'before all' hook we are skipping the remaining tests in the current suite, attributing a whole skipped suite to the promise error rather than to the assertion that actually failed (run 31462702539 shard 2,ME_CustomEnv_spec.ts).Completeness check: a brace-scan of every
Cypress.on(...)block acrossapp/client/cypressfinds exactly onecy.*call in each repo — this one. The same scan was validated against the pre-#42069 tree, where it correctly reportsFeatureFlags.ts:75.Type of change
Automation
/ok-to-test tags="@tag.All"
Related
https://linear.app/appsmith/issue/APP-15705
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/31490627773
Commit: caa5d6c
Cypress dashboard.
Tags:
@tag.AllSpec:
Tue, 11 Aug 2026 13:27:19 UTC
Summary by CodeRabbit