Skip to content

Commit

Permalink
fix(IsolatedTestRunnerAdapter): Don't kill processes using SIGKILL (#270
Browse files Browse the repository at this point in the history
)
  • Loading branch information
simondel authored Apr 7, 2017
1 parent 30e5ba3 commit f606e9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
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

0 comments on commit f606e9d

Please sign in to comment.