Uncaught exception: socket has been ended by the other party
See original GitHub issueHello!
I implemented a runner for the project I’m working on using the TestCafe API. With my coworkers, we noticed that some tests started failing after we upgraded NodeJS past version 10.15.3 (basically, no problem with 10.15.3 or below, but anything newer and we get the issue described here)
We randomly receive the following error:
× Scenario: Successful registration process (single step)
1) Uncaught exception:
Error: This socket has been ended by the other party
at TLSSocket.writeAfterFIN [as write] (net.js:407:14)
at Socket.ondata (_stream_readable.js:713:22)
at Socket.emit (events.js:200:13)
at Socket.EventEmitter.emit (domain.js:471:20)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at Socket.Readable.push (_stream_readable.js:210:10)
at TCP.onStreamRead (internal/stream_base_commons.js:166:17)
Browser: Chrome 84.0.4147.125 / Windows 10
Otherwise, the test itself does not have any reason to fail (one test will be fine for several runs, then fail with that error - and only that error)
I manage to trigger it by chaining a lot of navigateTo to our website. => I usually get a few fails out of 10 identical tests (see the test code)
My investigation so far shows that it seems to be linked to our usage of WebSocket. The issue only happens with Chrome, but we want coverage of all browsers (plus Firefox seems to not always close properly but that’s an issue for another time) Downgrading NodeJS solves the issue but the rest of the project now relies on a newer version, meaning we have to switch back and forth, which is not ideal.
I’m not sure you will have access to the website in the example - it is protected against access out of belgium. I might be able to arrange something if needed. I’ve reproduced the issue with another website (a completely different front-end, that we started from scratch so it does not have much in common with the current site) I was NOT able to reproduce the issue with external websites that use WebSocket (again, we might have a heavier load on the WS than the websites I tried)
Your website URL (or attach your complete example):
https://www.circus.beYour complete test code (or attach your test files):
fixture`Test the runner`;
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
test('Basic V3 test', async (t) => {
await t.navigateTo('https://www.circus.be').wait(5000);
});
Your Environment details:
- testcafe version: 1.9.1
- node.js version: 12.18.3
- browser name and version: Chrome 84
- platform and version: Windows 10
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (10 by maintainers)
Top GitHub Comments
@Arthy000
Hello,
No updates yet. We plan to research this issue, but I cannot give you any time frames as to when the issue will be resolved.
@Arthy000
Hello,
I checked it again and wasn’t able to reproduce the WebSoket (without TestCafe), and the following test passed without errors:
Result:
My setup: Windows 10, Node.js v14.15.4, TestCafe v1.11.0, Chrome 88.
I believe that the “This socket has been ended by the other party” error relates to the WebSoket error I faced before without TestCafe and thus this error should be fixed on the website side. I’ll close the issue.
@janrozycki
Hello,
If your scenario doesn’t relate to the @Arthy000 tested website, I recommend you create a new issue with a simple reproducible example.