Skip to content

test: terminate WPT workers after test completion - #37627

Closed
targos wants to merge 1 commit into
nodejs:masterfrom
targos:wpt-worker
Closed

test: terminate WPT workers after test completion#37627
targos wants to merge 1 commit into
nodejs:masterfrom
targos:wpt-worker

Conversation

@targos

Copy link
Copy Markdown
Member

No description provided.

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Mar 6, 2021
Comment threadtest/common/wpt.js
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
Copy Markdown
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
Copy Markdown
MemberAuthor

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

if(this[kHandle]===null)returnPromiseResolve();
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.
returnnewPromise((resolve)=>{
this.once('exit',resolve);
});
}

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

targos added a commit that referenced this pull request Mar 8, 2021
PR-URL: #37627
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@targos

Copy link
Copy Markdown
MemberAuthor

Landed in bba5aac

@targostargos closed this Mar 8, 2021
@targos
targos deleted the wpt-worker branch March 8, 2021 20:57
danielleadams pushed a commit that referenced this pull request Mar 16, 2021
PR-URL: #37627
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@danielleadamsdanielleadams mentioned this pull request Mar 16, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ciPRs that need a full CI run.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@targos@nodejs-github-bot@Trott@aduh95