Skip to content

Commit 105da90

Browse files
authored
fix(client): prevent socket.io from hanging due to mocked clocks (#3695)
1 parent ab9ebf8 commit 105da90

File tree

4 files changed

+54
-57
lines changed

4 files changed

+54
-57
lines changed

client/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ var socket = io(location.host, {
1616
reconnectionDelayMax: Infinity,
1717
timeout: BROWSER_SOCKET_TIMEOUT,
1818
path: KARMA_PROXY_PATH + KARMA_URL_ROOT.substr(1) + 'socket.io',
19-
'sync disconnect on unload': true
19+
'sync disconnect on unload': true,
20+
useNativeTimers: true
2021
})
2122

2223
// instantiate the updater of the view

package-lock.json

Lines changed: 48 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@
284284
"Merott Movahedi <[email protected]>",
285285
"Merrick Christensen <[email protected]>",
286286
"Michael Krotscheck <[email protected]>",
287+
"Michael Vartan <[email protected]>",
287288
"Michał Siwek <[email protected]>",
288289
"Milan Aleksic <[email protected]>",
289290
"Milana Stojadinov <[email protected]>",
@@ -435,7 +436,7 @@
435436
"qjobs": "^1.2.0",
436437
"range-parser": "^1.2.1",
437438
"rimraf": "^3.0.2",
438-
"socket.io": "^3.1.0",
439+
"socket.io": "^4.2.0",
439440
"source-map": "^0.6.1",
440441
"tmp": "^0.2.1",
441442
"ua-parser-js": "^0.7.28",

static/karma.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ var socket = io(location.host, {
338338
reconnectionDelayMax: Infinity,
339339
timeout: BROWSER_SOCKET_TIMEOUT,
340340
path: KARMA_PROXY_PATH + KARMA_URL_ROOT.substr(1) + 'socket.io',
341-
'sync disconnect on unload': true
341+
'sync disconnect on unload': true,
342+
useNativeTimers: true
342343
})
343344

344345
// instantiate the updater of the view

0 commit comments

Comments
 (0)