-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix channel closed error #219
Conversation
* Add an integration test for test runner that crashes with process.exit();
* Group all integration test test runners for maintanability
Replace the api based on lose promises with a `Task` class. Looks more readable.
* Refactor lose promises to use a simple Task-based api.
* Make sure a test runner gets restarted when the child process crashes. * Introduced a new `TestRunnerDecorator` base class which can be used to decorate a `TestRunner` with additional functionality. * Introduced a new `RetryDecorator` which is wrapped around the `TimeoutDecorator`. * Rename `IsolatedTestRunnerAdapterFactory` => `ResilientTestRunnerFacotry`.
* Fix bithound issue, readonly not yet supported.
As said during our hackathon, the I've also thought about renaming |
Ok, all issues fixed. Could you have a look to it again @simondel ? |
test/helpers/producers.ts
Outdated
@@ -1,4 +1,5 @@ | |||
import { MutantStatus, MatchedMutant, MutantResult } from 'stryker-api/report'; | |||
import * as sinon from 'sinon'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this import?
export default class RetryDecorator extends TestRunnerDecorator { | ||
private currentRunTask: Task<RunResult>; | ||
|
||
run(options: RunOptions): Promise<RunResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not pass the RunOptions
in a constructor? That way you have to create a new RetryDecorator
and you will not keep any state by accident.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure i follow your logic. The RunOptions
here are provided in the run
method as specified on the TestRunner
interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I was confused with the Config
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Takes you forever to merge!
Please have a look at the new
Task
api i've implemented. I think it looks a bit cleaner. Also removed the restart functionality from theIsolatedTestRunnerAdapter
and put it in aTimeoutDecorator
class. It looks a lot cleaner in my opinion. Its also easier to add debug functionality now, where the TestRunner runs in the same process as Stryker itself, because the timeout logic is not tightly coupled anymore with the spawning of new processes.New functionality can now be added in
TestRunnerDecorator
classes. TheRetryDecorator
implements retries whenever a child process dies (EPIPE error).