sorry-cypress: Cypress ESOCKETTIMEDOUT in case of error
Summary
Sorry cypress does not respond to Cypress back when Cypress detects syntax error in the code.
How to reproduce
I wrote a test where I used fs
but didn’t import it. So it throws error at runtime.
fs.readFile("some file");
In this case, Cypress gives expected error. And it tries to upload the test result but it fails
The error was:
SyntaxError: Unexpected token
at EventEmitter.handler (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/plugins/util.js:69:27)
at EventEmitter.emit (events.js:315:20)
at ChildProcess.<anonymous> (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/plugins/util.js:19:22)
at ChildProcess.emit (events.js:315:20)
at emit (internal/child_process.js:903:12)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
- A missing file or dependency
- A syntax error in the file or one of its dependencies
Fix the error in your code and re-run your tests.
(Uploading Results)
We encountered an unexpected error talking to our servers.
We will retry 3 more times in 30 seconds...
The server's response was:
RequestError: Error: ESOCKETTIMEDOUT
We encountered an unexpected error talking to our servers.
We will retry 2 more times in 1 minute...
The server's response was:
RequestError: Error: ESOCKETTIMEDOUT
We encountered an unexpected error talking to our servers.
We will retry 1 more time in 2 minutes...
The server's response was:
RequestError: Error: ESOCKETTIMEDOUT
We encountered an unexpected error talking to our servers.
We will retry 0 more times in ...
The server's response was:
RequestError: Error: ESOCKETTIMEDOUT
We encountered an unexpected error talking to our servers.
Because you passed the --parallel flag, this run cannot proceed because it requires a valid response from our servers.
The --ciBuildId flag you passed was: 1
The server's response was:
RequestError: Error: ESOCKETTIMEDOUT
These logs from sorry-cypress dashboard
>> Received instance results { instanceId: '9e20c009-80ea-4ead-a627-231f40d337c7' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:171:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:132:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
>> Received instance results { instanceId: '9e20c009-80ea-4ead-a627-231f40d337c7' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:171:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:132:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
>> Received instance results { instanceId: '9e20c009-80ea-4ead-a627-231f40d337c7' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:171:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:132:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)
Environment
- sorry-cypress version:
agoldis/sorry-cypress-director:1.1.1
- cypress version:
8.0.0
- platform:
ubuntu
- service:
director
I’m running docker run -p 1234:1234 agoldis/sorry-cypress-director
in local on Ubuntu machine.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18
Thanks a lot @agoldis it worked.
@amitguptagwl seems like my attempt to reproduce it is different from yours.
Would appreciate you sharing with me the output running cypress with DEBUG enabled. Basically I need to see what are the payloads that is trigger the errors. If you can scope it to just one single test that causes the crash, it’d be great!
@amitguptagwl yes, you test it out with
docker run -p 1234:1234 agoldis/sorry-cypress-director:2.0.0-beta.6