Skip to content

Commit

Permalink
fix(client): prevent socket.io from hanging due to mocked clocks (kar…
Browse files Browse the repository at this point in the history
  • Loading branch information
vartan authored and anthony-redFox committed May 5, 2023
1 parent 8ebfa85 commit 1cd5013
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
"Merott Movahedi <[email protected]>",
"Merrick Christensen <[email protected]>",
"Michael Krotscheck <[email protected]>",
"Michael Vartan <[email protected]>",
"Michał Siwek <[email protected]>",
"Milan Aleksic <[email protected]>",
"Milana Stojadinov <[email protected]>",
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
Original file line number Diff line number Diff line change
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 1cd5013

Please sign in to comment.