Skip to content

Conversation

@alexsch01
Copy link
Contributor

@alexsch01 alexsch01 commented Nov 3, 2025

Additional details

Steps to test

How has the user experience changed?

PR Tasks


Note

Suppress EPIPE errors from the config child process during load/setup, add a unit test, and note the fix in the changelog.

  • Runtime (data-context):
    • packages/data-context/src/data/ProjectConfigIpc.ts
      • Handle EPIPE in _childProcess.on('error') within loadConfig() and registerSetupIpcHandlers() by logging via debug, resolving the pending promise, and returning early.
      • Type narrow error handler to NodeJS.ErrnoException.
  • Tests:
    • Add packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts to simulate EPIPE and assert debug messages for both code paths.
  • Changelog:
    • Update cli/CHANGELOG.md (15.8.0 Bugfixes) to document the EPIPE terminal error fix.

Written by Cursor Bugbot for commit 47d8cb5. This will update automatically on new commits. Configure here.

@cypress-app-bot
Copy link
Collaborator

@alexsch01
Copy link
Contributor Author

The failures appear to be unrelated to the PR

@mschile mschile requested a review from AtofStryker November 4, 2025 17:37
@jennifer-shehane
Copy link
Member

@alexsch01 Thanks, we'll review when we have time and also make sure tests pass and merge.

@alexsch01
Copy link
Contributor Author

The readme change entry is in the wrong spot but I'm not going to fix it until all potential checks are complete

Copy link
Contributor

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

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

I'm not sure we would want to block all broken pipe errors coming back from the process but I can't think of a reason as to what specifically. So I'm OK moving forward with the change. @cacieprins cam you think of a scenario where this would be problematic?

@alexsch01 are you able to add a unit test to https://github.com/cypress-io/cypress/blob/develop/packages/data-context/test/unit/data/ProjectConfigIpc.spec.ts

@alexsch01
Copy link
Contributor Author

@alexsch01 are you able to add a unit test to https://github.com/cypress-io/cypress/blob/develop/packages/data-context/test/unit/data/ProjectConfigIpc.spec.ts

Since the original issue happens sporadically when doing CTRL+C, it's tricky to test this

@AtofStryker
Copy link
Contributor

@alexsch01 are you able to add a unit test to https://github.com/cypress-io/cypress/blob/develop/packages/data-context/test/unit/data/ProjectConfigIpc.spec.ts

Since the original issue happens sporadically when doing CTRL+C, it's tricky to test this

@alexsch01 I'm more so talking about a unit test that emits and error to a mock child process and verifies the reject handler isn't called. I can take a look in setting that up if you'd like if that seems a bit challenging to do.

@alexsch01
Copy link
Contributor Author

@AtofStryker done

@AtofStryker AtofStryker self-requested a review November 19, 2025 02:25
resolve()

return
}
Copy link

Choose a reason for hiding this comment

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

Bug: EPIPE handler resolves with wrong type

When an EPIPE error occurs in registerSetupIpcHandlers(), the promise resolves with undefined instead of the expected SetupNodeEventsReply object containing setupConfig, requires, and registrations properties. This causes runtime errors when callers try to access these properties, such as in ProjectConfigManager.handleSetupTestingTypeReply() which iterates over result.registrations.

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

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

the ipc main process is dead so I don't actually see this being a problem

resolve()

return
}
Copy link

Choose a reason for hiding this comment

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

Bug: Missing resolved flag prevents proper error handling

When EPIPE occurs in loadConfig(), the code calls resolve() but doesn't set resolved = true. If another error occurs afterward, handleChildProcessError will incorrectly call reject() on an already-resolved promise instead of calling onError(), causing subsequent errors to be silently ignored rather than properly reported.

Fix in Cursor Fix in Web

@AtofStryker
Copy link
Contributor

@alexsch01
Copy link
Contributor Author

@AtofStryker addressed

@AtofStryker AtofStryker self-requested a review November 25, 2025 20:54
@AtofStryker
Copy link
Contributor

Screenshot 2025-12-04 at 11 33 21 AM This test is failing on this branch but it appears to be flaky. I also verified that the changes here are not impacting the results of the test, so I am going to merge this in.

@AtofStryker AtofStryker merged commit a738f01 into cypress-io:develop Dec 4, 2025
63 of 65 checks passed
@alexsch01 alexsch01 deleted the hide-epipe-error branch December 4, 2025 16:38
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.

Error: write EPIPE after CTRL+C in terminal

4 participants