From 33f8822ceca94fc67edfcc0c7abb612dd08457a6 Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Mon, 3 Nov 2025 07:15:21 -0500 Subject: [PATCH 01/11] fix: don't show EPIPE error --- packages/data-context/src/data/ProjectConfigIpc.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/data-context/src/data/ProjectConfigIpc.ts b/packages/data-context/src/data/ProjectConfigIpc.ts index 45bbf068385..9ff8061a802 100644 --- a/packages/data-context/src/data/ProjectConfigIpc.ts +++ b/packages/data-context/src/data/ProjectConfigIpc.ts @@ -157,7 +157,11 @@ export class ProjectConfigIpc extends EventEmitter { let resolved = false - this._childProcess.on('error', (err) => { + this._childProcess.on('error', (err: NodeJS.ErrnoException) => { + if (err.code === 'EPIPE') { + return + } + debug('unhandled error in child process %s', err) this.handleChildProcessError(err, this, resolved, reject) reject(err) @@ -229,7 +233,11 @@ export class ProjectConfigIpc extends EventEmitter { return new Promise((resolve, reject) => { let resolved = false - this._childProcess.on('error', (err) => { + this._childProcess.on('error', (err: NodeJS.ErrnoException) => { + if (err.code === 'EPIPE') { + return + } + this.handleChildProcessError(err, this, resolved, reject) reject(err) }) From bd5a6a204ac065b03f4075e50a8ec0ab8750760f Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Mon, 3 Nov 2025 07:18:19 -0500 Subject: [PATCH 02/11] Update CHANGELOG.md --- cli/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index efa0ef2ba9d..a6a56d70efd 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -16,6 +16,7 @@ _Released 11/4/2025 (PENDING)_ - Fixed an issue with grouped console prop items having a hard to read blue color in the console log and duplicate `:` characters being displayed. Addressed in [#32776](https://github.com/cypress-io/cypress/pull/32776). - Added more context to the error message shown when `cy.prompt()` fails to download. Addressed in [#32822](https://github.com/cypress-io/cypress/pull/32822). - Fixed an issue where absolute file paths were not correctly determined from the source map when the source map root was updated. Fixes [#32809](https://github.com/cypress-io/cypress/issues/32809). +- Fixed an issue where a EPIPE error shows up after CTRL+C is done in terminal. Fixes [#30659](https://github.com/cypress-io/cypress/issues/30659). Addressed in [#32873](https://github.com/cypress-io/cypress/pull/32873). **Misc:** From daeab02b66a580f532db58dcf41f3eabdcb0f2a1 Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Sat, 8 Nov 2025 07:30:49 -0500 Subject: [PATCH 03/11] add debug statements --- packages/data-context/src/data/ProjectConfigIpc.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/data-context/src/data/ProjectConfigIpc.ts b/packages/data-context/src/data/ProjectConfigIpc.ts index 9ff8061a802..1e4be4f461d 100644 --- a/packages/data-context/src/data/ProjectConfigIpc.ts +++ b/packages/data-context/src/data/ProjectConfigIpc.ts @@ -159,6 +159,7 @@ export class ProjectConfigIpc extends EventEmitter { this._childProcess.on('error', (err: NodeJS.ErrnoException) => { if (err.code === 'EPIPE') { + debug('EPIPE error in loadConfig() of child process %s', err) return } @@ -235,6 +236,7 @@ export class ProjectConfigIpc extends EventEmitter { this._childProcess.on('error', (err: NodeJS.ErrnoException) => { if (err.code === 'EPIPE') { + debug('EPIPE error in registerSetupIpcHandlers() of child process %s', err) return } From 180e0b94691b15100d2a32beacd797f486f4a62f Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Fri, 14 Nov 2025 15:17:10 -0500 Subject: [PATCH 04/11] Create ProjectConfigIpc-real-child-process.spec.ts --- ...rojectConfigIpc-real-child-process.spec.ts | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts diff --git a/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts b/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts new file mode 100644 index 00000000000..daa8fa425ce --- /dev/null +++ b/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts @@ -0,0 +1,71 @@ +import { describe, expect, it, beforeEach, afterEach, jest } from '@jest/globals' +import { scaffoldMigrationProject as scaffoldProject } from '../helper' +import { ProjectConfigIpc } from '../../../src/data/ProjectConfigIpc' + +jest.mock('debug', () => { + globalThis.debugMessages = [] + const originalDebugModule = jest.requireActual('debug') + + const debug = (namespace) => { + // @ts-expect-error - mock + const originalDebug = originalDebugModule(namespace) + + return ((message) => { + if (namespace === 'cypress:lifecycle:ProjectConfigIpc') { + globalThis.debugMessages.push(message) + } + originalDebug(message) + }) + } + + debug.formatters = {} + + return debug +}) + +describe('ProjectConfigIpc', () => { + describe('real-child-process', () => { + let projectConfigIpc + + beforeEach(async () => { + const projectPath = await scaffoldProject('e2e') + + projectConfigIpc = new ProjectConfigIpc( + undefined, + undefined, + projectPath, + '', + false, + (error) => {}, + () => {}, + () => {}, + ) + }) + + afterEach(() => { + projectConfigIpc.cleanupIpc() + }) + + it('EPIPE error test', async () => { + const err: NodeJS.ErrnoException = new Error + err.code = 'EPIPE' + + const OG_once = projectConfigIpc.once + projectConfigIpc.once = function(evt, listener) { + if (evt === 'setupTestingType:reply') { + return listener() + } else { + return OG_once.apply(this, [evt, listener]) + } + } + + await projectConfigIpc.loadConfig() + await projectConfigIpc.registerSetupIpcHandlers() + + projectConfigIpc._childProcess.emit('error', err) + + expect(globalThis.debugMessages.at(-2)).toEqual('EPIPE error in loadConfig() of child process %s') + expect(globalThis.debugMessages.at(-1)).toEqual('EPIPE error in registerSetupIpcHandlers() of child process %s') + }) + }) +}) From c3738558d0015b01d509b9d330fb4a7716c9b8c8 Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Fri, 14 Nov 2025 15:27:47 -0500 Subject: [PATCH 05/11] Update CHANGELOG.md --- cli/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 102dc325cac..b8319c5e46a 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -7,6 +7,7 @@ _Released 11/18/2025 (PENDING)_ - Fixed an issue where [`cy.wrap()`](https://docs.cypress.io/api/commands/wrap) would cause infinite recursion and freeze the Cypress App when called with objects containing circular references. Fixes [#24715](https://github.com/cypress-io/cypress/issues/24715). Addressed in [#32917](https://github.com/cypress-io/cypress/pull/32917). - Fixed an issue where top changes on test retries could cause attempt numbers to show up more than one time in the reporter and cause attempts to be lost in Test Replay. Addressed in [#32888](https://github.com/cypress-io/cypress/pull/32888). +- Fixed an issue where a EPIPE error shows up after CTRL+C is done in terminal. Fixes [#30659](https://github.com/cypress-io/cypress/issues/30659). Addressed in [#32873](https://github.com/cypress-io/cypress/pull/32873). **Misc:** @@ -30,7 +31,6 @@ _Released 11/4/2025_ - Fixed an issue with grouped console prop items having a hard to read blue color in the console log and duplicate `:` characters being displayed. Addressed in [#32776](https://github.com/cypress-io/cypress/pull/32776). - Added more context to the error message shown when [`cy.prompt()`](https://docs.cypress.io/api/commands/prompt) fails to download. Addressed in [#32822](https://github.com/cypress-io/cypress/pull/32822). - Fixed an issue where absolute file paths were not correctly determined from the source map when the source map root was updated. Fixes [#32809](https://github.com/cypress-io/cypress/issues/32809). -- Fixed an issue where a EPIPE error shows up after CTRL+C is done in terminal. Fixes [#30659](https://github.com/cypress-io/cypress/issues/30659). Addressed in [#32873](https://github.com/cypress-io/cypress/pull/32873). **Misc:** From df27c443f6e8d37d9cb8e897f9d102f8c219e18b Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Fri, 14 Nov 2025 15:43:31 -0500 Subject: [PATCH 06/11] Linux lint --- packages/data-context/src/data/ProjectConfigIpc.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/data-context/src/data/ProjectConfigIpc.ts b/packages/data-context/src/data/ProjectConfigIpc.ts index 1e4be4f461d..5857a1824e5 100644 --- a/packages/data-context/src/data/ProjectConfigIpc.ts +++ b/packages/data-context/src/data/ProjectConfigIpc.ts @@ -160,6 +160,7 @@ export class ProjectConfigIpc extends EventEmitter { this._childProcess.on('error', (err: NodeJS.ErrnoException) => { if (err.code === 'EPIPE') { debug('EPIPE error in loadConfig() of child process %s', err) + return } @@ -237,6 +238,7 @@ export class ProjectConfigIpc extends EventEmitter { this._childProcess.on('error', (err: NodeJS.ErrnoException) => { if (err.code === 'EPIPE') { debug('EPIPE error in registerSetupIpcHandlers() of child process %s', err) + return } From c0ed5c24805c2cfa462f2ee5a59c7408f170b422 Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Fri, 14 Nov 2025 15:45:35 -0500 Subject: [PATCH 07/11] Linux lint --- .../unit/data/ProjectConfigIpc-real-child-process.spec.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts b/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts index daa8fa425ce..24a3c4b46cd 100644 --- a/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts +++ b/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts @@ -14,6 +14,7 @@ jest.mock('debug', () => { if (namespace === 'cypress:lifecycle:ProjectConfigIpc') { globalThis.debugMessages.push(message) } + originalDebug(message) }) } @@ -48,15 +49,16 @@ describe('ProjectConfigIpc', () => { it('EPIPE error test', async () => { const err: NodeJS.ErrnoException = new Error + err.code = 'EPIPE' const OG_once = projectConfigIpc.once - projectConfigIpc.once = function(evt, listener) { + + projectConfigIpc.once = function (evt, listener) { if (evt === 'setupTestingType:reply') { return listener() - } else { - return OG_once.apply(this, [evt, listener]) } + return OG_once.apply(this, [evt, listener]) } await projectConfigIpc.loadConfig() From 813d3f0d60d15bf7ce908f006267d340ca1c7374 Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Fri, 14 Nov 2025 16:01:18 -0500 Subject: [PATCH 08/11] Update ProjectConfigIpc-real-child-process.spec.ts --- .../test/unit/data/ProjectConfigIpc-real-child-process.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts b/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts index 24a3c4b46cd..916154f23e9 100644 --- a/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts +++ b/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts @@ -58,6 +58,7 @@ describe('ProjectConfigIpc', () => { if (evt === 'setupTestingType:reply') { return listener() } + return OG_once.apply(this, [evt, listener]) } From 5acba9651c6466babb4b3b34337b4afb03f30262 Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Wed, 19 Nov 2025 06:22:53 -0500 Subject: [PATCH 09/11] Update ProjectConfigIpc.ts --- packages/data-context/src/data/ProjectConfigIpc.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/data-context/src/data/ProjectConfigIpc.ts b/packages/data-context/src/data/ProjectConfigIpc.ts index 5857a1824e5..a2bee0662ee 100644 --- a/packages/data-context/src/data/ProjectConfigIpc.ts +++ b/packages/data-context/src/data/ProjectConfigIpc.ts @@ -161,6 +161,8 @@ export class ProjectConfigIpc extends EventEmitter { if (err.code === 'EPIPE') { debug('EPIPE error in loadConfig() of child process %s', err) + resolve() + return } @@ -239,6 +241,8 @@ export class ProjectConfigIpc extends EventEmitter { if (err.code === 'EPIPE') { debug('EPIPE error in registerSetupIpcHandlers() of child process %s', err) + resolve() + return } From 1440b55f242dfd8b4141785d77dda22ec1a2ccbd Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Wed, 19 Nov 2025 07:24:41 -0500 Subject: [PATCH 10/11] Update ProjectConfigIpc.ts --- packages/data-context/src/data/ProjectConfigIpc.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/data-context/src/data/ProjectConfigIpc.ts b/packages/data-context/src/data/ProjectConfigIpc.ts index a2bee0662ee..e097dc08267 100644 --- a/packages/data-context/src/data/ProjectConfigIpc.ts +++ b/packages/data-context/src/data/ProjectConfigIpc.ts @@ -161,6 +161,7 @@ export class ProjectConfigIpc extends EventEmitter { if (err.code === 'EPIPE') { debug('EPIPE error in loadConfig() of child process %s', err) + // @ts-ignore resolve() return @@ -241,6 +242,7 @@ export class ProjectConfigIpc extends EventEmitter { if (err.code === 'EPIPE') { debug('EPIPE error in registerSetupIpcHandlers() of child process %s', err) + // @ts-ignore resolve() return From 36e18190cf7381d3b7aaa69520fd62415950667a Mon Sep 17 00:00:00 2001 From: Alex Schwartz Date: Thu, 20 Nov 2025 17:24:48 -0500 Subject: [PATCH 11/11] avoid flake --- .../test/unit/data/ProjectConfigIpc-real-child-process.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts b/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts index 916154f23e9..43617b6de25 100644 --- a/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts +++ b/packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts @@ -69,6 +69,6 @@ describe('ProjectConfigIpc', () => { expect(globalThis.debugMessages.at(-2)).toEqual('EPIPE error in loadConfig() of child process %s') expect(globalThis.debugMessages.at(-1)).toEqual('EPIPE error in registerSetupIpcHandlers() of child process %s') - }) + }, 20_000) }) })