question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance issue and websocket error

See original GitHub issue

I just upgraded to version 1.0.0 and immediately noticed that my test suite takes much longer to run, now about 18 seconds when it finished in about 10 seconds before. My guess is there is something slow going on during startup because the first test result takes much longer to show up as done.

Even worse, every other time or so that I run my tests I get the following error during startup:

C:\path_to_project\node_modules\playwright-chromium\lib\server\chromium.js:211
            session.queue.push(parsedMessage);
                          ^

TypeError: Cannot read property 'push' of undefined
    at WebSocket.<anonymous> (C:\path_to_project\node_modules\playwright-chromium\lib\server\chromium.js:211:27)
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (C:\path_to_project\node_modules\ws\lib\websocket.js:789:20)
    at Receiver.emit (events.js:315:20)
    at Receiver.dataMessage (C:\path_to_project\node_modules\ws\lib\receiver.js:422:14)
    at Receiver.getData (C:\path_to_project\node_modules\ws\lib\receiver.js:352:17)
    at Receiver.startLoop (C:\path_to_project\node_modules\ws\lib\receiver.js:138:22)
    at Receiver._write (C:\path_to_project\node_modules\ws\lib\receiver.js:74:10)
    at writeOrBuffer (_stream_writable.js:352:12)
    at Receiver.Writable.write (_stream_writable.js:303:10)

This is not an error that I have seen before and when I revert to version 0.2.5 these issues go away.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:27 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
olschcommented, Jul 7, 2020

@mmarkelov I can verify that the next version of jest-playwright-preset (currently 1.3.0-rc1) together with next version of playwright-chromium (1.2.0-next.1594082323189) solves the performance issue that @DavidZidar reported above (#158) as long as you use launchType: 'LAUNCH'. Also, the crash issue appears to be gone. When I run my tests (8 test suites / 58 tests) with launchType: 'PERSISTENT' the behaviour is erratic. Only one of 5+ testruns finished successfully. The others were either hanging after the last testrun or crashing with the message A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown.. When I tried launchType: 'PERSISTENT' with v1.2.1 I didn’t have any of these problems. Running with launchType: 'SERVER' works fine but is very slow. BTW, I’m a colleague of @DavidZidar.

2reactions
DavidZidarcommented, Jun 25, 2020

Just tried upgrading to playwright-chromium@next and I can confirm the crashing issues I’ve had are gone! Great success.

It is still running much slower than before though, but that’s not as bad as outright crashing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Performance problem sending WebSocket frames - Swift Forums
To do this it sends and receives binary web socket frames. I'm on a 1 Gb network with a switch between the client...
Read more >
html - WebSockets performance - Stack Overflow
(socket.io) and canvas. I reckon that the calculation of the direction change has to be done client- AND serverside and then synchronized -...
Read more >
How do I troubleshoot WebSocket issues in Agents (All ...
The purpose of this article is to provide information on troubleshooting WebSocket issues with Agents in AM. This information applies to ...
Read more >
HTTP vs Websockets: A performance comparison
In many web applications, websockets are used to push messages to a ... This post compares the performance of request/responses between HTTP ...
Read more >
Intermittent errors with WebSockets - Cloudflare Community
The backend app servers run websockets for RabbitMQ connections. Some of our users are seeing intermittent errors/problems when going thr…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found