diff --git a/lib/launchers/process.js b/lib/launchers/process.js index 067cfae87..3ba8bce1e 100644 --- a/lib/launchers/process.js +++ b/lib/launchers/process.js @@ -134,6 +134,17 @@ var ProcessLauncher = function(spawn, tempDir, timer) { log.warn('%s was not killed in %d ms, sending SIGKILL.', self.name, killTimeout); self._process.kill('SIGKILL'); + + // NOTE: https://github.com/karma-runner/karma/pull/1184 + // NOTE: SIGKILL is just a signal. Processes should never ignore it, but they can. + // If a process gets into a state where it doesn't respond in a reasonable amout of time + // Karma should warn, and continue as though the kill succeeded. + // This a certainly suboptimal, but it is better than having the test harness hang waiting + // for a zombie child process to exit. + self._killTimer = timer.setTimeout(function() { + log.warn('%s was not killed by SIGKILL in %d ms, continuing.', self.name, killTimeout); + self._onProcessExit(-1, ''); + }, killTimeout); }; };