Skip to content
Open
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
1 change: 1 addition & 0 deletions client/bin/multi-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ class State {
case 1: return "1 (error)"; // client/lib/index.js#L401
case 2: return "2 (test failure)"; // client/lib/index.js#L323
case 3: return "3 (test error)"; // client/lib/index.js#L328
case 4: return "4 (testbot disconnect)"; // client/lib/index.js#L394
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting ^^

default: return `${c.code} (exception)`; // For all other outcomes
}
},
Expand Down
7 changes: 7 additions & 0 deletions client/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ module.exports = class Client extends PassThrough {
});

let capturedError = null;
let testDone = false;
const wsMessageHandler = ws => async pkg => {
try {
const { type, data } = JSON.parse(pkg);
Expand Down Expand Up @@ -341,6 +342,7 @@ module.exports = class Client extends PassThrough {
} else {
this.log(`Test suite has exited with: PASS`)
}
testDone = true;
break;
case 'error':
process.exitCode = 3;
Expand Down Expand Up @@ -405,6 +407,11 @@ module.exports = class Client extends PassThrough {
ws.on('close', () => {
this.log('WS connection is closed');
process.stdin.destroy();
// give exit code of 4 when WS is closed before tests report as finished
if(!testDone){
process.exitCode = 4
}

if (capturedError) {
reject(capturedError);
} else {
Expand Down