Skip to content

Commit 3ed0568

Browse files
authored
chore(ci): exit E2E tests only once actually done (#3252)
1 parent c732711 commit 3ed0568

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

test/e2e/run.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async function run() {
109109
console.log(`${colors.red('[fatal]')} test ${colors.yellow(`[${dir.name}]`)} failed with error: ${err}`);
110110
});
111111

112-
worker.on('exit', async (code) => {
112+
const exitHandler = async (code) => {
113113
if (code === SKIPPED_TEST_CLOSE_CODE) {
114114
console.log(`Test ${colors.yellow(`[${dir.name}]`)} was skipped`);
115115
return;
@@ -139,9 +139,17 @@ async function run() {
139139
}
140140

141141
if (status === 'failure') failure = true;
142+
};
143+
144+
worker.on('exit', async (exitCode) => {
145+
try {
146+
await exitHandler(exitCode);
147+
} finally {
148+
worker.emit('done');
149+
}
142150
});
143151

144-
await once(worker, 'exit');
152+
await once(worker, 'done');
145153
}
146154
}
147155

0 commit comments

Comments
 (0)