You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stryker 4.0 beta doesn't close when an error occurs. Instead, it keeps hanging with the last line ERROR StrykerCli There were failed tests in the initial test run.. This happens because the injectors are not disposed of correctly.
We should either implement nicojs/typed-inject#24 and use rootInjector.dispose(), or implement this:
letmutantInstrumenterInjector: Injector<MutantInstrumenterContext>|undefined;letdryRunExecutorInjector: Injector<DryRunContext>|undefined;letmutationRunExecutorInjector: Injector<MutationTestContext>|undefined;try{// 1. Prepare. Load Stryker configuration, load the input files and starts the logging serverconstprepareExecutor=this.injector.provideValue(coreTokens.cliOptions,this.cliOptions).injectClass(PrepareExecutor);mutantInstrumenterInjector=awaitprepareExecutor.execute();// 2. Mutate and instrument the files and write to the sandbox.constmutantInstrumenter=mutantInstrumenterInjector.injectClass(MutantInstrumenterExecutor);dryRunExecutorInjector=awaitmutantInstrumenter.execute();// 3. Perform a 'dry run' (initial test run). Runs the tests without active mutants and collects coverage.constdryRunExecutor=dryRunExecutorInjector.injectClass(DryRunExecutor);mutationRunExecutorInjector=awaitdryRunExecutor.execute();// 4. Actual mutation testing. Will check every mutant and if valid run it in an available test runner.constmutationRunExecutor=mutationRunExecutorInjector.injectClass(MutationTestExecutor);constmutantResults=awaitmutationRunExecutor.execute();returnmutantResults;}finally{if(mutationRunExecutorInjector){awaitmutationRunExecutorInjector.dispose();}elseif(dryRunExecutorInjector){awaitdryRunExecutorInjector.dispose();}elseif(mutantInstrumenterInjector){awaitmutantInstrumenterInjector.dispose();}}
However, this wouldn't be enough, because the DryRunExecutor currently creates its own test runner:
Exit with non-zero exit code when an error occurs.
* Update typed-inject to v3 in order to dispose of the `rootInjector`
* Rename some e2e tests to better reflect what they're testing.
* Add an e2e test for a failing dry run.
Fixes#2315
Summary
Stryker 4.0 beta doesn't close when an error occurs. Instead, it keeps hanging with the last line
ERROR StrykerCli There were failed tests in the initial test run.
. This happens because the injectors are not disposed of correctly.We should either implement nicojs/typed-inject#24 and use
rootInjector.dispose()
, or implement this:However, this wouldn't be enough, because the
DryRunExecutor
currently creates its own test runner:If something goes wrong during initial test run (dry run), the
testRunnerInjector
should also be disposed of correctly.It might be better to implement nicojs/typed-inject#24 .
The text was updated successfully, but these errors were encountered: