Skip to content
Closed
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
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 @@ -496,6 +498,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();
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's safe to ignore the Promise status, maybe add an empty catch handler?

Suggested change
this.workers.get(filename).terminate();
this.workers.get(filename).terminate().catch(() => {});

Copy link
Member Author

Choose a reason for hiding this comment

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

This promise can never reject

node/lib/internal/worker.js

Lines 344 to 354 in f3d3769

if (this[kHandle] === null) return PromiseResolve();
this[kHandle].stopThread();
// Do not use events.once() here, because the 'exit' event will always be
// emitted regardless of any errors, and the point is to only resolve
// once the thread has actually stopped.
return new Promise((resolve) => {
this.once('exit', resolve);
});
}

}

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