Skip to content

Commit

Permalink
Set exit code as null
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanduplenskikh committed Jul 12, 2024
1 parent 5c653ae commit d60590d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions node/test/toolrunnertests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ describe('Toolrunner Tests', function () {
fs.unlinkSync(semaphorePath);
delete process.env['TASKLIB_TEST_TOOLRUNNER_EXITDELAY'];
});
})
});

signals.forEach(signal => {
it(`Handle child process killing with ${signal} signal`, function (done) {
this.timeout(10000);
Expand Down Expand Up @@ -540,12 +541,11 @@ describe('Toolrunner Tests', function () {
done(new Error('should not have been successful'));
done();
})
.catch(function (err) {
.catch(function () {
if (typeof signal === 'number') {
signal = Object.keys(os.constants.signals).find(x => os.constants.signals[x] == signal) as NodeJS.Signals;
}
console.log("toolRunnerDebug", toolRunnerDebug);
assert(toolRunnerDebug.filter(x => x.indexOf(`STDIO streams have closed and received exit code ${err} and signal ${signal} for tool '${tool}'`) >= 0).length > 0);
assert(toolRunnerDebug.pop(), `STDIO streams have closed and received exit code null and signal ${signal} for tool '${tool}'`);
done();
})
.catch(function (err) {
Expand All @@ -559,6 +559,7 @@ describe('Toolrunner Tests', function () {
shell.killChildProcess(signal);
});
});

it('Handles child process holding streams open and non-zero exit code', function (done) {
this.timeout(10000);

Expand Down

0 comments on commit d60590d

Please sign in to comment.