test: terminate WPT workers after test completion

PR-URL: https://github.com/nodejs/node/pull/37627
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Michaël Zasso 2021-03-06 11:51:39 +01:00 committed by Danielle Adams
parent b7ef829dac
commit f7edb07ec2
No known key found for this signature in database
GPG Key ID: D3A89613643B6201
2 changed files with 6 additions and 1 deletions

View File

@ -299,6 +299,7 @@ class WPTRunner {
this.results = {}; this.results = {};
this.inProgress = new Set(); this.inProgress = new Set();
this.workers = new Map();
this.unexpectedFailures = []; this.unexpectedFailures = [];
} }
@ -376,6 +377,7 @@ class WPTRunner {
scriptsToRun, scriptsToRun,
}, },
}); });
this.workers.set(testFileName, worker);
worker.on('message', (message) => { worker.on('message', (message) => {
switch (message.type) { switch (message.type) {
@ -501,6 +503,9 @@ class WPTRunner {
this.resultCallback(filename, { status: 2, name: 'Unknown' }); this.resultCallback(filename, { status: 2, name: 'Unknown' });
} }
this.inProgress.delete(filename); this.inProgress.delete(filename);
// Always force termination of the worker. Some tests allocate resources
// that would otherwise keep it alive.
this.workers.get(filename).terminate();
} }
addTestResult(filename, item) { addTestResult(filename, item) {

View File

@ -1,6 +1,6 @@
{ {
"Blob-constructor.any.js": { "Blob-constructor.any.js": {
"skip": "https://github.com/nodejs/node/issues/37358" "skip": "Depends on File API"
}, },
"Blob-constructor-dom.window.js": { "Blob-constructor-dom.window.js": {
"skip": "Depends on DOM API" "skip": "Depends on DOM API"