Skip to content

Commit

Permalink
test: terminate WPT workers after test completion
Browse files Browse the repository at this point in the history
PR-URL: #37627
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
targos authored and danielleadams committed Mar 16, 2021
1 parent b7ef829 commit f7edb07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/common/wpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class WPTRunner {

this.results = {};
this.inProgress = new Set();
this.workers = new Map();
this.unexpectedFailures = [];
}

Expand Down Expand Up @@ -376,6 +377,7 @@ class WPTRunner {
scriptsToRun,
},
});
this.workers.set(testFileName, worker);

worker.on('message', (message) => {
switch (message.type) {
Expand Down Expand Up @@ -501,6 +503,9 @@ class WPTRunner {
this.resultCallback(filename, { status: 2, name: 'Unknown' });
}
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) {
Expand Down
2 changes: 1 addition & 1 deletion test/wpt/status/FileAPI/blob.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Blob-constructor.any.js": {
"skip": "https://github.com/nodejs/node/issues/37358"
"skip": "Depends on File API"
},
"Blob-constructor-dom.window.js": {
"skip": "Depends on DOM API"
Expand Down

0 comments on commit f7edb07

Please sign in to comment.