fix(sigint): remove sigint handler early (#10266)
This commit is contained in:
parent
7eec66d0f9
commit
8dcd77270f
|
|
@ -177,7 +177,6 @@ export async function showHTMLReport(reportFolder: string | undefined, testId?:
|
|||
if (testId)
|
||||
url += `#?testId=${testId}`;
|
||||
open(url);
|
||||
process.on('SIGINT', () => process.exit(0));
|
||||
await new Promise(() => {});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -290,6 +290,11 @@ export class Runner {
|
|||
if (!list) {
|
||||
const dispatcher = new Dispatcher(this._loader, testGroups, this._reporter);
|
||||
await Promise.race([dispatcher.run(), sigIntPromise]);
|
||||
if (!sigint) {
|
||||
// We know for sure there was no Ctrl+C, so we remove custom SIGINT handler
|
||||
// as soon as we can.
|
||||
process.off('SIGINT', sigintHandler);
|
||||
}
|
||||
await dispatcher.stop();
|
||||
hasWorkerErrors = dispatcher.hasWorkerErrors();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue