Skip to content
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(IsolatedTestRunnerAdapter): Don't kill processes using SIGKILL #270

Merged
merged 1 commit into from
Apr 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default class TestRunnerChildProcessAdapter extends EventEmitter implemen
this.currentTask = new DisposeTask(MAX_WAIT_FOR_DISPOSE);
this.sendDisposeCommand();
return this.currentTask.promise
.then(() => this.workerProcess.kill('SIGKILL'));
.then(() => this.workerProcess.kill());
}

private sendRunCommand(options: RunOptions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,17 @@ describe('IsolatedTestRunnerAdapter', () => {
return expect(fakeChildProcess.send).to.have.been.calledWith(serialize({ kind: 'dispose' }));
});

describe('and child process responses to dispose', () => {
describe('and child process responds to dispose', () => {
beforeEach(() => {
const promise = sut.dispose();
receiveMessage({ kind: 'disposeDone' });
return promise;
});

it('should kill the child process', () =>
expect(fakeChildProcess.kill).to.have.been.calledWith());
it('should kill the child process', () => {
expect(fakeChildProcess.kill).to.not.have.been.calledWith('SIGKILL');
expect(fakeChildProcess.kill).to.have.been.called;
});
});

describe('and a timeout occurred', () => {
Expand All @@ -144,8 +146,10 @@ describe('IsolatedTestRunnerAdapter', () => {
return promise;
});

it('should kill the child process', () =>
expect(fakeChildProcess.kill).to.have.been.calledWith('SIGKILL'));
it('should kill the child process', () => {
expect(fakeChildProcess.kill).to.not.have.been.calledWith('SIGKILL');
expect(fakeChildProcess.kill).to.have.been.called;
});
});
});
it('should reject any exceptions', () => {
Expand Down