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.

v6 coverage runs can fail dues to maxHttpBufferSize change in socket.io v3

See original GitHub issue

Hi guys,

Our build starts to fail when we upgrade karma to v6.0.0. All tests run without problem, but Karma thinks the browser disconnects right after executing the tests (or the browser actually disconnects, but that doesn’t make Karma yell in v5.2).

I tracked it down and reproduced with a single test running in .only (we’re using Mocha as a framework) so I suppose it’s not a problem with the actual tests, but maybe related to the actual amount of JS code we’re oading in the browser. Again, in v5.2 they run fine.

I’m attaching karma.v5.log and karma.v6.log in DEBUG level that show the exact same run, one with 5.2.3 and the other with 6.0.0. The only step in-between these two runs is the upgrade of Karma.

A few additional information on our setup (and you have the full config object at the beginning of the log file)

I’m kinda stuck now, not knowing where to go to track the problem even further. I will provide any additional information you may require but would appreciate help from Karma’s community. In addition, I volounteer to make a PR if we eventually find a problem in Karma itself !

Thanks, Regards,

David

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
robertknightcommented, Jan 19, 2021

The maximum payload size is coming from here in engine.io: https://github.com/socketio/engine.io/blob/e5b307c16d8e7594fcec4eb23508f23f78546dc6/lib/server.js#L29.

Changing the maxHttpBufferSize value locally to a larger value solves the issue for me. Obviously this configuration needs to be overridden in the proper way.

The fact that Istanbul sends all of its code coverage data over the WebSocket in one request at the end of the test run is probably not ideal, but that’s going to be harder to fix.

1reaction
johnjbartoncommented, Jan 20, 2021

I think we can set the maxHttpBufferSize to 1e8 to avoid most cases.

From https://socket.io/docs/v3/migrating-from-2-x-to-3-0/index.html

Saner default values
  * the default value of maxHttpBufferSize was decreased from 100MB to 1MB.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating from 2.x to 3.0 - Socket.IO
TL;DR: due to several breaking changes, a v2 client will not be able to connect to a v3 server (and vice versa). Update:...
Read more >
Troubleshooting connection issues | Socket.IO
IO client is not a WebSocket implementation and thus will not be able to establish a connection with a WebSocket server, ...
Read more >
Troubleshooting connection issues | Socket.IO
IO client will always try to reconnect, unless specifically told otherwise. Let's review how you can troubleshoot a connection failure.
Read more >
Server options - Socket.IO
serveClient ​. Default value: true. Whether to serve the client files. If true , the different bundles will be served at the following ......
Read more >
Server API - Socket.IO
For example, if the underlying TCP connection is not closed properly due to a network issue, a client may have to wait up...
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