Skip to content

Commit

Permalink
fix(client): prevent socket.io from hanging due to mocked clocks (#3695)
Browse files Browse the repository at this point in the history
  • Loading branch information
vartan committed Oct 19, 2021
1 parent ab9ebf8 commit 105da90
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 57 deletions.
3 changes: 2 additions & 1 deletion client/main.js
Expand Up @@ -16,7 +16,8 @@ var socket = io(location.host, {
reconnectionDelayMax: Infinity,
timeout: BROWSER_SOCKET_TIMEOUT,
path: KARMA_PROXY_PATH + KARMA_URL_ROOT.substr(1) + 'socket.io',
'sync disconnect on unload': true
'sync disconnect on unload': true,
useNativeTimers: true
})

// instantiate the updater of the view
Expand Down
102 changes: 48 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -284,6 +284,7 @@
"Merott Movahedi <merott@merott.com>",
"Merrick Christensen <merrick.christensen@gmail.com>",
"Michael Krotscheck <krotscheck@gmail.com>",
"Michael Vartan <michaelvartan@google.com>",
"Michał Siwek <mike21@aol.pl>",
"Milan Aleksic <milanaleksic@gmail.com>",
"Milana Stojadinov <mstojadinov@renderedtext.com>",
Expand Down Expand Up @@ -435,7 +436,7 @@
"qjobs": "^1.2.0",
"range-parser": "^1.2.1",
"rimraf": "^3.0.2",
"socket.io": "^3.1.0",
"socket.io": "^4.2.0",
"source-map": "^0.6.1",
"tmp": "^0.2.1",
"ua-parser-js": "^0.7.28",
Expand Down
3 changes: 2 additions & 1 deletion static/karma.js
Expand Up @@ -338,7 +338,8 @@ var socket = io(location.host, {
reconnectionDelayMax: Infinity,
timeout: BROWSER_SOCKET_TIMEOUT,
path: KARMA_PROXY_PATH + KARMA_URL_ROOT.substr(1) + 'socket.io',
'sync disconnect on unload': true
'sync disconnect on unload': true,
useNativeTimers: true
})

// instantiate the updater of the view
Expand Down

0 comments on commit 105da90

Please sign in to comment.