-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dispose): clean up child processes in alternative flows (#1520)
Make sure Stryker doesn't _hang indefinitely_ when it supposed to _exit prematurely_. Before, there was a code path that didn't dispose all child processes. Now using typed-injects [dispose functionality](https://github.com/nicojs/typed-inject/#-disposing-provided-stuff).
- Loading branch information
Showing
14 changed files
with
113 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"presets": [ | ||
"@babel/env" | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "exit-prematurely", | ||
"version": "1.0.0", | ||
"private": true, | ||
"description": "A module to test the alternative flow when Stryker should exit prematurely, see https://github.com/stryker-mutator/stryker/issues/1519", | ||
"main": "index.js", | ||
"scripts": { | ||
"pretest": "rimraf \"reports\" stryker.log .stryker-tmp ", | ||
"test": "stryker run", | ||
"posttest": "mocha --require ts-node/register verify/*.ts" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = function (config) { | ||
config.set({ | ||
mutate: [ | ||
'src/*.js' | ||
], | ||
testFramework: 'mocha', | ||
testRunner: 'mocha', | ||
coverageAnalysis: 'off', | ||
mutator: 'javascript', | ||
transpilers: [ | ||
'babel' | ||
], | ||
timeoutMS: 60000, | ||
reporters: ['clear-text', 'html', 'event-recorder'], | ||
maxConcurrentTestRunners: 2, | ||
logLevel: 'info', | ||
fileLogLevel: 'info' | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Idle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"declaration": false | ||
}, | ||
"files": [ | ||
"verify/verify.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as fs from 'fs'; | ||
import { expect } from 'chai'; | ||
|
||
describe('Verify stryker has ran correctly', () => { | ||
|
||
const strykerLog = fs.readFileSync('./stryker.log', 'utf8'); | ||
|
||
it('exit prematurely', async () => { | ||
expect(strykerLog).contains('No tests were executed. Stryker will exit prematurely.'); | ||
}); | ||
|
||
it('should log about a mutant free world', async () => { | ||
expect(strykerLog).contains('It\'s a mutant-free world, nothing to test'); | ||
}); | ||
|
||
it('should warn about the globbing expression resulting in no files', () => { | ||
expect(strykerLog).contains('Globbing expression "src/*.js" did not result in any files.'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters