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.

When the socket from a browser timeout, reconnection of the socket doesn't get handled by testem

See original GitHub issue

I am experiencing browser timeout inconsistently as part of my test execution. I was able to observe that when this happens, the socket was closed and testem receives a disconnect event that starts the timer for the browser timeout error. During this time, socketio will reconnect the socket via a new id. But since testem does not handle the reconnection, the timeout will expire and the browser timeout error will be thrown.

To reproduce this, I added debug logs from socket.io in both server & client side: DEBUG=socket.io:* when executing test command And on the browser, setting localStorage.debug = '*'

From Client side, I get logs as such:

engine.io-client:socket socket close with reason transport close socket.io-client:manager onclose socket.io-client:manager cleanup socket.io-client:manager cleanup transport close socket.io-client:manager will wait %dms before reconnect attempt 579 socket.io-client:manager attempting reconnect socket.io-client:manager readyState closed socket.io-client:manager opening localhost:7357 engine.io-client:socket creating transport polling engine.io-client:polling polling engine.io-client:polling-xhr xhr poll engine.io-client:polling-xhr xhr open GET http://localhost:7357/socket.io/?EIO=3&transport=polling&t=MBpRduP engine.io-client:polling-xhr xhr data null engine.io-client:socket setting transport polling socket.io-client:manager connect attempt will timeout after 20000 engine.io-client:polling polling got data “96:0{"sid":"0kZ0foLaS_CiaQf1AAAQ","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000}2:40” engine.io-client:socket socket receive: type open engine.io-client:socket socket open socket.io-client:manager open socket.io-client:manager cleanup socket.io-client:socket transport is open - connecting socket.io-client:manager reconnect success

From the testem side, i get:

2018-04-23T16:55:27.515Z socket.io:server incoming connection with id 0kZ0foLaS_CiaQf1AAAQ 2018-04-23T16:55:27.515Z socket.io:client connecting to namespace / 2018-04-23T16:55:27.515Z socket.io:namespace adding socket to nsp / 2018-04-23T16:55:27.515Z socket.io:socket socket connected - writing packet 2018-04-23T16:55:27.515Z socket.io:socket joining room 0kZ0foLaS_CiaQf1AAAQ 2018-04-23T16:55:27.516Z socket.io:socket packet already sent in initial handshake 2018-04-23T16:55:27.516Z socket.io:socket joined room 0kZ0foLaS_CiaQf1AAAQ

This is related to #1021.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
step2yeungcommented, Sep 15, 2018

Closing this issue since it has been taken care off by #1276

0reactions
stefanpennercommented, Aug 3, 2018

@step2yeung whats the current state of this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Socket Timeout — An Important and Sometimes Complicated ...
During my experience working with Python, I've had several cases where a network client was left hanging while trying to request a server....
Read more >
ConnectionTimeout versus SocketTimeout - Stack Overflow
A connection timeout occurs only upon starting the TCP connection. This usually happens if the remote machine does not answer.
Read more >
Session timeout in BrowserStack Automate
Socket timeouts or SO_TIMEOUT happen when the browser becomes unresponsive for a period of 240 seconds post which, the unresponsive browser is killed, ......
Read more >
What to do when experiencing NL-NETWORK-01 errors
Network: If only some of the user load is getting this error at different ... a connection; Socket Timeout: waiting time when receiving...
Read more >
Resolve connection timeouts when I connect Service to EKS
If your pods aren't registered as backends for the Service, then you can receive a timeout error. This can happen when you access...
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