Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPIPE error when running Cypress in Mac #30317

Open
YuvarajSaravanan opened this issue Sep 30, 2024 · 2 comments
Open

EPIPE error when running Cypress in Mac #30317

YuvarajSaravanan opened this issue Sep 30, 2024 · 2 comments
Labels
stage: needs information Not enough info to reproduce the issue

Comments

@YuvarajSaravanan
Copy link

YuvarajSaravanan commented Sep 30, 2024

Current behavior

When running my cypress test through cypress run --e2e command I am facing write EPIPE error. This issue crashes my application and test stops abruptly. I have 30specs and issue occurs during cypress run command while cypress open works fine.

Node version: 21.7,3
Cypress version: 13.13.0
OS: macOS Sonoma 14.6.1

This issue happens only in my mac machine, when tested on a windows machine the test runs smooth.

ERROR:

write EPIPE
Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
ERR_FAILED (-2) loading '[http://localhost:4002/__/#/specs/runner?file=cypress/e2e/18-test.cy.ts'](http://localhost:4002/__/#/specs/runner?file=cypress/e2e/18-test.cy.ts%27)
Error: ERR_FAILED (-2) loading '[http://localhost:4002/__/#/specs/runner?file=cypress/e2e/18-test.cy.ts'](http://localhost:4002/__/#/specs/runner?file=cypress/e2e/18-test.cy.ts%27)
    at rejectAndCleanup (node:electron/js2c/browser_init:2:75584)
    at WebContents.stopLoadingListener (node:electron/js2c/browser_init:2:75971)
    at WebContents.emit (node:events:514:28)

Desired behavior

As per this, the EPIPE errors has been handled in Windows machine. Expect the same for mac machine also.
EPIPE error on Windows runs
catch EPIPE errors

Test code to reproduce

Running test through "cypress run --e2e". also I am using start-server-and-test to start my application server before starting cypress test.

Cypress Version

13.13.0

Node version

21.7.3

Operating System

macOS Sonoma 14.6.1

Debug Logs

cypress:server:remote-states getting remote state: { auth: null, origin: 'http://localhost:4002', strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '4002', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } for: http://localhost:4002 +1ms
  cypress:net-stubbing:server:util sending event to driver { eventName: 'after:response', data: { eventId: 'event4161', subscription: { eventName: 'after:response', await: false, routeId: '1727332108803-2' }, browserRequestId: '48141.128', requestId: 'interceptedRequest4157', data: {} } } +6ms
write EPIPE
Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
  cypress:server:cloud:api request to url: POST https://api.cypress.io/exceptions with params: {"body":{"err":{"name":"Error","message":"write EPIPE","stack":"Error: write EPIPE\n    at WriteWrap.onWriteComplete [as oncomplete] (node:internal<stripped-path>stream_base_commons:94:16)"},"version":"13.14.2","osName":"darwin","osVersion":"23.6.0","osCpus":[{"model":"Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz","speed":2400,"times":{"user":7378520,"nice":0,"sys":2203560,"idle":9240900,"irq":0}},{"model":"Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz","speed":2400,"times":{"user":1115700,"nice":0,"sys":410360,"idle":17312770,"irq":0}},{"model":"Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz","speed":2400,"times":{"user":6990010,"nice":0,"sys":1915260,"idle":9921060,"irq":0}},{"model":"Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz","speed":2400,"times":{"user":1129470,"nice":0,"sys":404950,"idle":17306110,"irq":0}},{"model":"Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz","speed":2400,"times":{"user":6651340,"nice":0,"sys":1743250,"idle":10440770,"irq":0}},{"model":"Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz","speed":2400,"times":{"user":1139880,"nice":0,"sys":398830,"idle":17304940,"irq":0}},{"model":"Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz","speed":2400,"times":{"user":6430430,"nice":0,"sys":1636230,"idle":10776170,"irq":0}},{"model":"Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz","speed":2400,"times":{"user":1154660,"nice":0,"sys":395400,"idle":17295700,"irq":0}}],"osMemory":{"free":1303494656,"total":17179869184}},"headers":{"x-os-name":"darwin","x-cypress-version":"13.14.2"}} and token: undefined +0ms
  cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/exceptions' } +3s
  cypress:network:connect beginning getAddress { hostname: 'api.cypress.io', port: 443 } +5s
  cypress:server:browsers:electron closed event fired +9s
  cypress:server:windows error removing all extensions { err: TypeError: Object has been destroyed at Object.j (<embedded>:2753:127297) at BrowserWindow.<anonymous> (<embedded>:2753:141101)     at Object.onceWrapper (node:events:629:26)     at BrowserWindow.emit (node:events:526:35) at <embedded>:2759:19253 at tryCatcher (/Users/user/Library/Caches/Cypress/13.14.2/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/user/Library/Caches/Cypress/13.14.2/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/Users/user/Library/Caches/Cypress/13.14.2/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/Users/user/Library/Caches/Cypress/13.14.2/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/Users/user/Library/Caches/Cypress/13.14.2/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:694:18) at _drainQueueStep (/Users/user/Library/Caches/Cypress/13.14.2/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:138:12) at _drainQueue (/Users/user/Library/Caches/Cypress/13.14.2/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:131:9) at Async._drainQueues (/Users/user/Library/Caches/Cypress/13.14.2/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:147:5) at Immediate._onImmediate (/Users/user/Library/Caches/Cypress/13.14.2/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:17:14)     at process.processImmediate (node:internal/timers:476:21), extensions: undefined } +9s
  cypress:server:browsers browser instance exit event received { code: undefined, signal: undefined } +7s
  cypress:server:preprocessor removeFile /Users/my_folder/cypress/e2e/19-test.ts +7s
  cypress:server:preprocessor base emitter plugin close event +0ms
  cypress:server:preprocessor base emitter native close event +0ms
  cypress:server:browsers:electron clearInstanceState called with options { options: {} } +0ms
  cypress:server:browsers:electron closing remote interface client +0ms
  cypress:server:browsers:cri-client closing +9s
  cypress:server:browsers:cri-client closing cri client { closed: false, target: '99A9324602AB5293417C9B6540' } +0ms
  cypress:server:browsers:cdp-connection:99A93246A9902AB5293440 disconnect of target 99A93246A35F9B5293417C9B6540 requested. { terminated: false, connection: true, reconnection: false } +9s
  cypress:server:browsers browsers.kill called with no active instance +1ms
  cypress:proxy:http:util:prerequests metrics: { browserPreRequestsReceived: 4756, proxyRequestsReceived: 3785, immediatelyMatchedRequests: 3066, unmatchedRequests: 0, unmatchedPreRequests: 494 } +0ms
  cypress:webpack close /Users/my_folder/cypress/e2e/19-test.ts +7s`

Other

This issue occurs at random spec file. I have 30 specs and sometimes at 18th spec and sometime 19th or 20th spec file facing this EPIPE issue.

@jennifer-shehane
Copy link
Member

@YuvarajSaravanan Can you narrow down your use case of your run and provide a reproducible example? Since this is not a commonly reported error, I expect something is specific to your use case that would cause this.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Oct 1, 2024
@YuvarajSaravanan
Copy link
Author

Hi @jennifer-shehane, The error occurs randomly during my test and there is no exact way to reproduce the error.

I was using start-server-and-test to start my server and then run the cypress test, during the run when the EPIPE error appears the entire application process stops and exits.

To test further, I tried without using start-server-and-test. I have started the application (next dev command) in a separate terminal and cypress command(npx cypress run --e2e) in a separate terminal. Found that the EPIPE error is happening at the terminal running the cypress and this time my application continue to run without exit but only the cypress command exited after the EPIPE error.

Also I found that some reports similar to this case in below issues,
Bug: Crash "Error: write EPIPE" when running all specs

seems this issue has been fixed in the windows machine,
#1841
catch EPIPE errors

but in mac machines the issue still exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue
Projects
None yet
Development

No branches or pull requests

2 participants