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
Cypress ESOCKETTIMEDOUT in case of error #425
Comments
@agoldis Have you incorporate this fix in v2.0-beta.6 ? |
@amitguptagwl yes, you test it out with |
This issue still persists. I ran Running: features/articlestack/filters/journeys.feature (9 of 64)
Oops...we found an error preparing this test file:
cypress/integration/features/articlestack/filters/journeys.feature
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.
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 0 │
│ Passing: 0 │
│ Failing: 1 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: 0 seconds │
│ Spec Ran: features/articlestack/filters/journeys.feature │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(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
^C
real 6m59.452s
user 0m0.467s
sys 0m0.063s
amit@amit:~/.../cytorus_code/test-repository(cypress-latest)$ time npx cy2 run --record --key demo --parallel --ci-build-id 2 --spec cypress/integration/features/articlestack/filters/journeys.feature
[cy2] Running cypress with API URL: http://localhost:1234/
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 8.0.0 │
│ Browser: Electron 89 (headless) │
│ Specs: 1 found (features/articlestack/filters/journeys.feature) │
│ Searched: cypress/integration/features/articlestack/filters/journeys.feature │
│ Params: Tag: false, Group: false, Parallel: true │
│ Run URL: http://localhost:8080/run/f3dda7e1ebec1f810d20105a72ae0510 │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: features/articlestack/filters/journeys.feature (2 of 1)
Feature: Testing filters
✓ Scenario: journey to the category page (15495ms)
✓ Scenario: journey to the search result (14211ms)
✓ Scenario: journey via search page to category page (36075ms)
✓ Scenario: journey via search page, category page to tags page (31036ms)
✓ Scenario: route with no parameter (23465ms)
- Updating test results
5 passing (2m)
1 pending
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 6 │
│ Passing: 5 │
│ Failing: 0 │
│ Pending: 1 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: 2 minutes, 3 seconds │
│ Spec Ran: features/articlestack/filters/journeys.feature │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Uploading Results)
- Nothing to Upload
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ features/articlestack/filters/journ 02:03 6 5 - 1 - │
│ eys.feature │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! 02:03 6 5 - 1 -
───────────────────────────────────────────────────────────────────────────────────────────────────────
Recorded Run: http://localhost:8080/run/f3dda7e1ebec1f810d20105a72ae0510
real 2m12.645s
user 0m42.032s
sys 0m6.429s |
Once the tests in 1 terminal ends, they also fail for the same reason I originally reported. << Sending new task to machine {
spec: 'cypress/integration/features/SyntaxError.feature',
instanceId: '048adbf5-a55d-40f8-bfa4-19fde562d2d2',
claimedAt: '2021-09-01T00:32:19.392Z',
completedAt: null,
groupId: '1'
}
>> Received instance results { instanceId: '048adbf5-a55d-40f8-bfa4-19fde562d2d2' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 10)
>> Received instance results { instanceId: '048adbf5-a55d-40f8-bfa4-19fde562d2d2' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 12)
>> Received instance results { instanceId: '048adbf5-a55d-40f8-bfa4-19fde562d2d2' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 14)
>> Received instance results { instanceId: '048adbf5-a55d-40f8-bfa4-19fde562d2d2' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 16)
>> Received instance results { instanceId: '048adbf5-a55d-40f8-bfa4-19fde562d2d2' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 18)
|
@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!
|
Here is the stdout DEBUG=cypress:server:api npx cy2 run --record --key demo --parallel --ci-build-id 4 --spec cypress/integration/features/SyntaxError.feature
[cy2] Running cypress with API URL: http://localhost:1234/
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 8.0.0 │
│ Browser: Electron 89 (headless) │
│ Specs: 1 found (features/SyntaxError.feature) │
│ Searched: cypress/integration/features/SyntaxError.feature │
│ Params: Tag: false, Group: false, Parallel: true │
│ Run URL: http://localhost:8080/run/5518935bc335fd29542d2647dbc508bf │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: features/SyntaxError.feature (2 of 1)
Oops...we found an error preparing this test file:
cypress/integration/features/SyntaxError.feature
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.
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 0 │
│ Passing: 0 │
│ Failing: 1 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: 0 seconds │
│ Spec Ran: features/SyntaxError.feature │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(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: 4
The server's response was:
RequestError: Error: ESOCKETTIMEDOUT Here are the logs from sorry-cypress >> Machine is joining / creating a run { ciBuildId: '4', group: null, ci: { params: null, provider: null } }
<< Responding to machine {
groupId: '4',
machineId: '627e1147-f1aa-42bd-b02a-4b832a9554c5',
runId: '5518935bc335fd29542d2647dbc508bf',
runUrl: 'http://localhost:8080/run/5518935bc335fd29542d2647dbc508bf',
isNewRun: true,
warnings: []
}
>> Machine is requesting a new task {
runId: '5518935bc335fd29542d2647dbc508bf',
machineId: '627e1147-f1aa-42bd-b02a-4b832a9554c5',
groupId: '4'
}
<< Sending new task to machine {
spec: 'cypress/integration/features/SyntaxError.feature',
instanceId: '278e18fc-e51e-476b-b5d1-c67b73ea86b7',
claimedAt: '2021-09-02T02:25:10.172Z',
completedAt: null,
groupId: '4'
}
>> Received instance results { instanceId: '278e18fc-e51e-476b-b5d1-c67b73ea86b7' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 20)
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 22)
>> Received instance results { instanceId: '278e18fc-e51e-476b-b5d1-c67b73ea86b7' }
>> Received instance results { instanceId: '278e18fc-e51e-476b-b5d1-c67b73ea86b7' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 24)
>> Received instance results { instanceId: '278e18fc-e51e-476b-b5d1-c67b73ea86b7' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 26)
>> Received instance results { instanceId: '278e18fc-e51e-476b-b5d1-c67b73ea86b7' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111:42)
at runMicrotasks (<anonymous>)
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: 28) |
One more question (not related to this thread), how can I run |
Unfortunately the stdout you posted doesn't have any DEBUG output. I think DEBUG doesn't print the messages to stdout, but to stderr instead. Re: background |
No! DEBUG prints to stdout. Because I use it in my app too. I was even surprised why it was printing nothing in this case. Any other way to figure it out? Otherwise it'll leave the bug in this library. |
@amitguptagwl Here's how cypress output looks like with DEBUG enabled. Please note the lines with
I'd be better if you post the payload of the requests so I can troubleshoot and close it. |
I used 2021-09-02T15:10:28.901Z cypress:server:api retry #4 after undefinedms
2021-09-02T15:10:28.902Z cypress:server:api request to url: POST http://localhost:1234/instances/436508b3-1dcb-4fe9-937f-55f2cd0a8029/results with params: {"body":{"stats":{"failures":1,"tests":0,"passes":0,"pending":0,"suites":0,"skipped":0,"wallClockDuration":0,"wallClockStartedAt":"2021-09-02T15:02:52.867Z","wallClockEndedAt":"2021-09-02T15:02:52.867Z"},"tests":null,"exception":"Oops...we found an error preparing this test file:\n\n cypress/integration/features/SyntaxError.feature\n\nThe error was:\n\nSyntaxError: Unexpected token\n at EventEmitter.handler (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/plugins/util.js:69:27)\n at EventEmitter.emit (events.js:315:20)\n at ChildProcess.<anonymous> (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/plugins/util.js:19:22)\n at ChildProcess.emit (events.js:315:20)\n at emit (internal/child_process.js:903:12)\n at processTicksAndRejections (internal/process/task_queues.js:81:21)\n\nThis occurred while Cypress was compiling and bundling your test code. This is usually caused by:\n\n- A missing file or dependency\n- A syntax error in the file or one of its dependencies\n\nFix the error in your code and re-run your tests.","video":false,"screenshots":[],"reporterStats":null,"metadata":{"studioCreated":0,"studioExtended":0}},"headers":{"x-route-version":"1","x-cypress-request-attempt":4,"x-os-name":"linux","x-cypress-version":"8.0.0"}} and token: undefined
2021-09-02T15:10:28.902Z cypress:network:agent addRequest called { isHttps: false, href: 'http://localhost:1234/instances/436508b3-1dcb-4fe9-937f-55f2cd0a8029/results' }
2021-09-02T15:10:28.902Z cypress:network:agent got family { family: 4, href: 'http://localhost:1234/instances/436508b3-1dcb-4fe9-937f-55f2cd0a8029/results' }
2021-09-02T15:10:35.675Z cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
┌─────────┬───────────────────┬──────────────┬──────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
│ (index) │ group │ processCount │ pids │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
├─────────┼───────────────────┼──────────────┼──────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
│ 0 │ 'electron-shared' │ 4 │ '647511, 647672, 647512, 647959' │ 0 │ 0.02 │ 236.39 │ 233.51 │ 236.62 │
│ 1 │ 'cypress' │ 1 │ '647509' │ 0.43 │ 0.49 │ 228.14 │ 223.88 │ 229.19 │
│ 2 │ 'plugin' │ 1 │ '648084' │ 0 │ 0 │ 105.85 │ 105.85 │ 105.86 │
│ 3 │ 'other' │ 2 │ '664429, 664430' │ 0 │ 0.04 │ 3.28 │ 3.26 │ 3.36 │
│ 4 │ 'TOTAL' │ 8 │ '-' │ 0.43 │ 0.55 │ 573.66 │ 564.24 │ 574.7 │
└─────────┴───────────────────┴──────────────┴──────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ and this 2021-09-02T15:11:35.467Z cypress:server:record failed updating instance { stack: 'RequestError: Error: ESOCKETTIMEDOUT\n' + ' at new RequestError (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/request-promise-core/lib/errors.js:14:15)\n' + ' at Request.plumbing.callback (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/request-promise-core/lib/plumbing.js:87:29)\n' + ' at Request.RP$callback [as _callback] (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/request-promise-core/lib/plumbing.js:46:31)\n' + ' at self.callback (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/@cypress/request/request.js:185:22)\n' + ' at Request.emit (events.js:315:20)\n' + ' at ClientRequest.<anonymous> (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/@cypress/request/request.js:819:16)\n' + ' at Object.onceWrapper (events.js:421:28)\n' + ' at ClientRequest.emit (events.js:315:20)\n' + ' at Socket.emitRequestTimeout (_http_client.js:784:9)\n' + ' at Object.onceWrapper (events.js:421:28)\n' + ' at Socket.emit (events.js:327:22)\n' + ' at Socket._onTimeout (net.js:483:8)\n' + ' at listOnTimeout (internal/timers.js:554:17)\n' + ' at processTimers (internal/timers.js:497:7)\n' }
2021-09-02T15:11:35.470Z cypress:server:cypress exiting with err Error: 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: 8
The server's response was:
RequestError: Error: ESOCKETTIMEDOUT
at Object.get (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/errors.js:1012:15)
at throwDashboardCannotProceed (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/modes/record.js:59:29)
at /home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/lib/modes/record.js:237:5
at tryCatcher (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18)
at _drainQueueStep (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:461:21)
{
isCypressErr: true,
type: 'DASHBOARD_CANNOT_PROCEED_IN_PARALLEL',
details: undefined,
isFatalApiErr: true
}
2021-09-02T15:11:35.471Z cypress:server:cypress calling exit 1
2021-09-02T15:11:35.471Z cypress:server:cypress about to exit with code 1
2021-09-02T15:11:35.472Z cypress:server:browsers browsers.kill called with no active instance
2021-09-02T15:11:35.472Z cypress:proxy:http:util:prerequests metrics: { browserPreRequestsReceived: 3, proxyRequestsReceived: 0, immediatelyMatchedRequests: 0, eventuallyReceivedPreRequest: [], neverReceivedPreRequest: [] }
cypress:cli child event fired { event: 'exit', code: 1, signal: null } +9m |
@agoldis please let me know if you're looking for any other logs I've also noticed that this can be easily reproduced by throwing error manually from the code. |
Reproduction steps
const { fakeServer } = require("cypress/types/sinon")
describe('example to-do app', () => {
it.only('displays two todo items by default', () => {
cy.visit('https://example.cypress.io/todo')
cy.get('.todo-list li').should('have.length', 2)
cy.get('.todo-list li').first().should('have.text', 'Pay electric bill')
//throw new Error("on my wish"); //this works
//cy.then( () => { //This doesn't work
// throw new Error("on my wish");
//})
fs.readFile("fileDoesn'tExist.js"); //This doesn't work
});
});
$ DEBUG=cypress:* npx cy2 run --record --key demo --parallel --ci-build-id 12 --spec cypress/integration/1-getting-started/todo.spec.js Some logs from the console cypress:server:api request to url: POST http://localhost:1234/instances/e3c0bbd7-5ab0-4f38-9b25-6ddecb30ebf2/results with params: {"body":{"stats":{"failures":1,"tests":0,"passes":0,"pending":0,"suites":0,"skipped":0,"wallClockDuration":0,"wallClockStartedAt":"2021-09-05T02:03:42.871Z","wallClockEndedAt":"2021-09-05T02:03:42.871Z"},"tests":null,"exception":"Oops...we found an error preparing this test file:\n\n cypress/integration/1-getting-started/todo.spec.js\n\nThe error was:\n\nError: Webpack Compilation Error\n./cypress/integration/1-getting-started/todo.spec.js\nModule not found: Error: Can't resolve 'cypress/types/sinon' in '/home/amit/temp/cytorus_code/test-repository/test/cypress/integration/1-getting-started'\nresolve 'cypress/types/sinon' in '/home/amit/temp/cytorus_code/test-repository/test/cypress/integration/1-getting-started'\n Parsed request is a module\n using description file: /home/amit/temp/cytorus_code/test-repository/package.json (relative path: ./test/cypress/integration/1-getting-started)\n Field 'browser' doesn't contain a valid alias configuration\n Looked for and couldn't find the file at the following paths:\n[/home/amit/temp/cytorus_code/test-repository/test/cypress/integration/1-getting-started/node_modules]\n[/home/amit/temp/cytorus_code/test-repository/test/cypress/integration/node_modules]\n[/home/amit/temp/cytorus_code/test-repository/test/cypress/node_modules]\n[/home/amit/temp/cytorus_code/test-repository/test/node_modules]\n[/home/amit/temp/node_modules]\n[/home/amit/node_modules]\n[/home/node_modules]\n[/node_modules]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon.js]\n[/home/amit/temp/cytorus_code/node_modules/cypress/types/sinon]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon.json]\n[/home/amit/temp/cytorus_code/node_modules/cypress/types/sinon.js]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon.jsx]\n[/home/amit/temp/cytorus_code/node_modules/cypress/types/sinon.json]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon.mjs]\n[/home/amit/temp/cytorus_code/node_modules/cypress/types/sinon.jsx]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon.coffee]\n[/home/amit/temp/cytorus_code/node_modules/cypress/types/sinon.mjs]\n[/home/amit/temp/cytorus_code/node_modules/cypress/types/sinon.coffee]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon/index]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon/index.js]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon/index.json]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon/index.jsx]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon/index.mjs]\n[/home/amit/temp/cytorus_code/test-repository/node_modules/cypress/types/sinon/index.coffee]\n @ ./cypress/integration/1-getting-started/todo.spec.js 5:4-34\n \n at handle (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:176:23)\n at finalCallback (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:257:39)\n at /home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:306:14\n at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)\n at AsyncSeriesHook.lazyCompileHook (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/Hook.js:154:20)\n at /home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:304:22\n at Compiler.emitRecords (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:499:39)\n at /home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:298:10\n at /home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:485:14\n at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)\n at AsyncSeriesHook.lazyCompileHook (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/Hook.js:154:20)\n at /home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:482:27\n at /home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/neo-async/async.js:2818:7\n at done (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/neo-async/async.js:3522:9)\n at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)\n at AsyncSeriesHook.lazyCompileHook (/home/amit/.cache/Cypress/8.0.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/Hook.js:154:20)\n\nThis occurred while Cypress was compiling and bundling your test code. This is usually caused by:\n\n- A missing file or dependency\n- A syntax error in the file or one of its dependencies\n\nFix the error in your code and re-run your tests.","video":false,"screenshots":[],"reporterStats":null,"metadata":{"studioCreated":0,"studioExtended":0}},"headers":{"x-route-version":"1","x-cypress-request-attempt":0,"x-os-name":"linux","x-cypress-version":"8.0.0"}} and token: undefined +3s
I hope this will help to solve the issue. I found that Cypress in itself can't handle this situation and reports Webpack Compilation Error |
@amitguptagwl thanks for posting the detailed repro step - that was helpful. Please check out beta.9, it'd resolve this issue |
@agoldis Same problem with beta.9 >> Machine is joining / creating a run { ciBuildId: '1', group: null, ci: { params: null, provider: null } }
<< Responding to machine {
groupId: '1',
machineId: 'efc62169-8091-414b-8f21-0fc1c5909218',
runId: '331cbd69da882dfaad03e540ed3a2c0a',
runUrl: 'http://localhost:8080/run/331cbd69da882dfaad03e540ed3a2c0a',
isNewRun: true,
warnings: []
}
>> Machine is requesting a new task {
runId: '331cbd69da882dfaad03e540ed3a2c0a',
machineId: 'efc62169-8091-414b-8f21-0fc1c5909218',
groupId: '1'
}
<< Sending new task to machine {
spec: 'cypress/integration/features/SyntaxError.feature',
instanceId: '31882fe6-b9fe-4258-8bda-a55d5154a340',
claimedAt: '2021-09-10T02:46:34.352Z',
completedAt: null,
groupId: '1'
}
>> Received instance results { instanceId: '31882fe6-b9fe-4258-8bda-a55d5154a340' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111: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: '31882fe6-b9fe-4258-8bda-a55d5154a340' }
(node:1) UnhandledPromiseRejectionWarning: Error: AppError
at Object.updateInstanceResults (/app/packages/director/dist/execution/in-memory.js:167:11)
at updateInstanceResults (/app/packages/director/dist/api/instances.js:111: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) From cypress logs cypress:server:run spec results { error: 'Oops...we found an error preparing this test file:\n' + '\n' + ' cypress/integration/features/SyntaxError.feature\n' + '\n' + 'The error was:\n' + '\n' + 'SyntaxError: Unexpected token\n' + ' at EventEmitter.handler (/home/amit/.cache/Cypress/8.3.1/Cypress/resources/app/packages/server/lib/plugins/util.js:69:27)\n' + ' at EventEmitter.emit (events.js:315:20)\n' + ' at ChildProcess.<anonymous> (/home/amit/.cache/Cypress/8.3.1/Cypress/resources/app/packages/server/lib/plugins/util.js:19:22)\n' + ' at ChildProcess.emit (events.js:315:20)\n' + ' at emit (internal/child_process.js:903:12)\n' + ' at processTicksAndRejections (internal/process/task_queues.js:81:21)\n' + '\n' + '\n' + 'This occurred while Cypress was compiling and bundling your test code. This is usually caused by:\n' + '\n' + '- A missing file or dependency\n' + '- A syntax error in the file or one of its dependencies\n' + '\n' + 'Fix the error in your code and re-run your tests.', stats: { failures: 1, tests: 0, passes: 0, pending: 0, suites: 0, skipped: 0, wallClockDuration: 0, wallClockStartedAt: '2021-09-10T02:51:27.121Z', wallClockEndedAt: '2021-09-10T02:51:27.121Z' }, hooks: null, tests: null, video: null, screenshots: [], reporterStats: null, spec: { name: 'features/SyntaxError.feature', relative: 'cypress/integration/features/SyntaxError.feature', absolute: '/home/amit/temp/cytorus_code/test-repository/cypress/integration/features/SyntaxError.feature', specType: 'integration' }, shouldUploadVideo: true } +772ms
cypress:server:record after spec run { spec: { name: 'features/SyntaxError.feature', relative: 'cypress/integration/features/SyntaxError.feature', absolute: '/home/amit/temp/cytorus_code/test-repository/cypress/integration/features/SyntaxError.feature', specType: 'integration' } } +0ms
(Uploading Results)
cypress:server:api request to url: POST http://localhost:1234/instances/88b2017c-dad9-4e1d-a3c5-a99dc20faaa1/results with params: {"body":{"stats":{"failures":1,"tests":0,"passes":0,"pending":0,"suites":0,"skipped":0,"wallClockDuration":0,"wallClockStartedAt":"2021-09-10T02:51:27.121Z","wallClockEndedAt":"2021-09-10T02:51:27.121Z"},"tests":null,"exception":"Oops...we found an error preparing this test file:\n\n cypress/integration/features/SyntaxError.feature\n\nThe error was:\n\nSyntaxError: Unexpected token\n at EventEmitter.handler (/home/amit/.cache/Cypress/8.3.1/Cypress/resources/app/packages/server/lib/plugins/util.js:69:27)\n at EventEmitter.emit (events.js:315:20)\n at ChildProcess.<anonymous> (/home/amit/.cache/Cypress/8.3.1/Cypress/resources/app/packages/server/lib/plugins/util.js:19:22)\n at ChildProcess.emit (events.js:315:20)\n at emit (internal/child_process.js:903:12)\n at processTicksAndRejections (internal/process/task_queues.js:81:21)\n\n\nThis occurred while Cypress was compiling and bundling your test code. This is usually caused by:\n\n- A missing file or dependency\n- A syntax error in the file or one of its dependencies\n\nFix the error in your code and re-run your tests.","video":false,"screenshots":[],"reporterStats":null,"metadata":{"studioCreated":0,"studioExtended":0}},"headers":{"x-route-version":"1","x-cypress-request-attempt":0,"x-os-name":"linux","x-cypress-version":"8.3.1"}} and token: undefined +3s
cypress:network:agent addRequest called { isHttps: false, href: 'http://localhost:1234/instances/88b2017c-dad9-4e1d-a3c5-a99dc20faaa1/results' } +9s
cypress:network:agent got family { family: 4, href: 'http://localhost:1234/instances/88b2017c-dad9-4e1d-a3c5-a99dc20faaa1/results' } +1ms
cypress:server:api retry #1 after 30000ms +2m
cypress:server:api request to url: POST http://localhost:1234/instances/88b2017c-dad9-4e1d-a3c5-a99dc20faaa1/results with params: {"body":{"stats":{"failures":1,"tests":0,"passes":0,"pending":0,"suites":0,"skipped":0,"wallClockDuration":0,"wallClockStartedAt":"2021-09-10T02:51:27.121Z","wallClockEndedAt":"2021-09-10T02:51:27.121Z"},"tests":null,"exception":"Oops...we found an error preparing this test file:\n\n cypress/integration/features/SyntaxError.feature\n\nThe error was:\n\nSyntaxError: Unexpected token\n at EventEmitter.handler (/home/amit/.cache/Cypress/8.3.1/Cypress/resources/app/packages/server/lib/plugins/util.js:69:27)\n at EventEmitter.emit (events.js:315:20)\n at ChildProcess.<anonymous> (/home/amit/.cache/Cypress/8.3.1/Cypress/resources/app/packages/server/lib/plugins/util.js:19:22)\n at ChildProcess.emit (events.js:315:20)\n at emit (internal/child_process.js:903:12)\n at processTicksAndRejections (internal/process/task_queues.js:81:21)\n\n\nThis occurred while Cypress was compiling and bundling your test code. This is usually caused by:\n\n- A missing file or dependency\n- A syntax error in the file or one of its dependencies\n\nFix the error in your code and re-run your tests.","video":false,"screenshots":[],"reporterStats":null,"metadata":{"studioCreated":0,"studioExtended":0}},"headers":{"x-route-version":"1","x-cypress-request-attempt":1,"x-os-name":"linux","x-cypress-version":"8.3.1"}} and token: undefined +1ms
cypress:network:agent addRequest called { isHttps: false, href: 'http://localhost:1234/instances/88b2017c-dad9-4e1d-a3c5-a99dc20faaa1/results' } +2m
cypress:network:agent got family { family: 4, href: 'http://localhost:1234/instances/88b2017c-dad9-4e1d-a3c5-a99dc20faaa1/results' } +1ms Cypress: 8.3.1 If you don't mind, can you please reopen the issue? |
@agoldis have you get the chance to check this? |
@amitguptagwl sorry, I think I have fixed that in 2.0.0-beta.12, would you give it a try? |
Thanks a lot @agoldis it worked. |
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.In this case, Cypress gives expected error. And it tries to upload the test result but it fails
These logs from sorry-cypress dashboard
Environment
agoldis/sorry-cypress-director:1.1.1
8.0.0
ubuntu
director
I'm running
docker run -p 1234:1234 agoldis/sorry-cypress-director
in local on Ubuntu machine.The text was updated successfully, but these errors were encountered: