{"action":"created","issue":{"url":"https://api.github.com/repos/testem/testem/issues/1247","repository_url":"https://api.github.com/repos/testem/testem","labels_url":"https://api.github.com/repos/testem/testem/issues/1247/labels{/name}","comments_url":"https://api.github.com/repos/testem/testem/issues/1247/comments","events_url":"https://api.github.com/repos/testem/testem/issues/1247/events","html_url":"https://github.com/testem/testem/issues/1247","id":317842401,"node_id":"MDU6SXNzdWUzMTc4NDI0MDE=","number":1247,"title":"When the socket from a browser timeout, reconnection of the socket doesn't get handled by testem","user":{"login":"step2yeung","id":9669889,"node_id":"MDQ6VXNlcjk2Njk4ODk=","avatar_url":"https://avatars3.githubusercontent.com/u/9669889?v=4","gravatar_id":"","url":"https://api.github.com/users/step2yeung","html_url":"https://github.com/step2yeung","followers_url":"https://api.github.com/users/step2yeung/followers","following_url":"https://api.github.com/users/step2yeung/following{/other_user}","gists_url":"https://api.github.com/users/step2yeung/gists{/gist_id}","starred_url":"https://api.github.com/users/step2yeung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/step2yeung/subscriptions","organizations_url":"https://api.github.com/users/step2yeung/orgs","repos_url":"https://api.github.com/users/step2yeung/repos","events_url":"https://api.github.com/users/step2yeung/events{/privacy}","received_events_url":"https://api.github.com/users/step2yeung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-26T01:03:09Z","updated_at":"2018-06-05T01:07:43Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I am experiencing browser timeout inconsistently as part of my test execution.\r\nI 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.\r\nDuring 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.\r\n\r\nTo reproduce this, I added debug logs from socket.io in both server & client side:\r\n`DEBUG=socket.io:*` when executing test command\r\nAnd on the browser, setting `localStorage.debug = '*'`\r\n\r\nFrom Client side, I get logs as such:\r\n>engine.io-client:socket socket close with reason transport close\r\nsocket.io-client:manager onclose\r\nsocket.io-client:manager cleanup\r\nsocket.io-client:manager cleanup transport close\r\nsocket.io-client:manager will wait %dms before reconnect attempt 579\r\nsocket.io-client:manager attempting reconnect\r\nsocket.io-client:manager readyState closed\r\nsocket.io-client:manager opening localhost:7357\r\nengine.io-client:socket creating transport polling\r\nengine.io-client:polling polling\r\nengine.io-client:polling-xhr xhr poll\r\nengine.io-client:polling-xhr xhr open GET http://localhost:7357/socket.io/?EIO=3&transport=polling&t=MBpRduP\r\nengine.io-client:polling-xhr xhr data null\r\nengine.io-client:socket setting transport polling\r\nsocket.io-client:manager connect attempt will timeout after 20000\r\nengine.io-client:polling polling got data \"96:0{\\\"sid\\\":\\\"0kZ0foLaS_CiaQf1AAAQ\\\",\\\"upgrades\\\":[\\\"websocket\\\"],\\\"pingInterval\\\":25000,\\\"pingTimeout\\\":5000}2:40\"\r\nengine.io-client:socket socket receive: type open\r\nengine.io-client:socket socket open\r\nsocket.io-client:manager open\r\nsocket.io-client:manager cleanup \r\nsocket.io-client:socket transport is open - connecting\r\nsocket.io-client:manager reconnect success\r\n\r\nFrom the testem side, i get:\r\n\r\n>2018-04-23T16:55:27.515Z socket.io:server incoming connection with id 0kZ0foLaS_CiaQf1AAAQ\r\n2018-04-23T16:55:27.515Z socket.io:client connecting to namespace /\r\n2018-04-23T16:55:27.515Z socket.io:namespace adding socket to nsp /\r\n2018-04-23T16:55:27.515Z socket.io:socket socket connected - writing packet\r\n2018-04-23T16:55:27.515Z socket.io:socket joining room 0kZ0foLaS_CiaQf1AAAQ\r\n2018-04-23T16:55:27.516Z socket.io:socket packet already sent in initial handshake\r\n2018-04-23T16:55:27.516Z socket.io:socket joined room 0kZ0foLaS_CiaQf1AAAQ\r\n\r\n\r\nThis is related to #1021."},"comment":{"url":"https://api.github.com/repos/testem/testem/issues/comments/394547726","html_url":"https://github.com/testem/testem/issues/1247#issuecomment-394547726","issue_url":"https://api.github.com/repos/testem/testem/issues/1247","id":394547726,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDU0NzcyNg==","user":{"login":"step2yeung","id":9669889,"node_id":"MDQ6VXNlcjk2Njk4ODk=","avatar_url":"https://avatars3.githubusercontent.com/u/9669889?v=4","gravatar_id":"","url":"https://api.github.com/users/step2yeung","html_url":"https://github.com/step2yeung","followers_url":"https://api.github.com/users/step2yeung/followers","following_url":"https://api.github.com/users/step2yeung/following{/other_user}","gists_url":"https://api.github.com/users/step2yeung/gists{/gist_id}","starred_url":"https://api.github.com/users/step2yeung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/step2yeung/subscriptions","organizations_url":"https://api.github.com/users/step2yeung/orgs","repos_url":"https://api.github.com/users/step2yeung/repos","events_url":"https://api.github.com/users/step2yeung/events{/privacy}","received_events_url":"https://api.github.com/users/step2yeung/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T01:07:43Z","updated_at":"2018-06-05T01:07:43Z","author_association":"CONTRIBUTOR","body":"I agree with your assumption that most tests shouldn't be blocking for more than 1 minute.\r\n\r\nI believe that the main thread being blocked is one of the many possibilities that is causing a timeout. \r\nWhile trying to find out more reasons that causes a timeout, I found 2 ways that will trigger a browser timeout that will block the main thread indefinitely:\r\n1) infinite loop\r\n2) alert() and confirm() "}}
{"actor":{"display_login":"step2yeung"}}