Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force socket.io to always use native timeouts, preventing Karma from hanging due to mocked clocks. #3695

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 <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
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