Skip to content

Commit

Permalink
fix: add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
devoto13 committed Mar 12, 2022
1 parent c411e99 commit 727469e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class Browser {
}

onComplete (result) {
this.log.info('received completed event from the socket')
if (this.isNotConnected()) {
this.setState(CONNECTED)
this.lastResult.totalTimeEnd()
Expand Down
5 changes: 5 additions & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ class Server extends KarmaEventEmitter {

const emitRunCompleteIfAllBrowsersDone = () => {
if (Object.keys(singleRunDoneBrowsers).every((key) => singleRunDoneBrowsers[key])) {
this.log.info('emitted run_complete')
this.emit('run_complete', singleRunBrowsers, singleRunBrowsers.getResults(singleRunBrowserNotCaptured, config))
}
}
Expand Down Expand Up @@ -353,6 +354,7 @@ class Server extends KarmaEventEmitter {

// This is the normal exit trigger.
this.on('browser_complete_with_no_more_retries', function (completedBrowser) {
this.log.info('handling browser_complete_with_no_more_retries event')
singleRunDoneBrowsers[completedBrowser.id] = true

if (launcher.kill(completedBrowser.id)) {
Expand Down Expand Up @@ -450,10 +452,12 @@ class Server extends KarmaEventEmitter {
}
})

this.log.info('close point 1')
this.emitExitAsync(exitCode).catch((err) => {
this.log.error('Error while calling exit event listeners\n' + err.stack || err)
return 1
}).then((code) => {
this.log.info('close point 2')
socketServer.sockets.removeAllListeners()
socketServer.close()

Expand All @@ -462,6 +466,7 @@ class Server extends KarmaEventEmitter {
if (removeAllListenersDone) {
return
}
this.log.info('close point 3')
removeAllListenersDone = true
webServer.removeAllListeners()
processWrapper.removeAllListeners()
Expand Down

0 comments on commit 727469e

Please sign in to comment.