Skip to content

Commit

Permalink
fix(server): don't wait for socket.io store expiration timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
pkozlowski-opensource committed Apr 29, 2014
1 parent 074bc26 commit cd30a42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/server.js
Expand Up @@ -245,6 +245,11 @@ var createSocketIoServer = function(webServer, executor, config) {
var server = io.listen(webServer, {
// avoid destroying http upgrades from socket.io to get proxied websockets working
'destroy upgrade': false,
// socket.io has a timeout (15s by default) before destroying a store (a data structure where
// data associated with a socket are stored). Unfortunately this timeout is not cleared
// properly on socket.io shutdown and this timeout prevents karma from exiting cleanly.
// We change this timeout to 0 to make Karma exit just after all tests were executed.
'client store expiration': 0,
logger: logger.create('socket.io', constant.LOG_ERROR),
resource: config.urlRoot + 'socket.io',
transports: config.transports
Expand Down

0 comments on commit cd30a42

Please sign in to comment.