Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esm: increase test coverage of edge cases #47033

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Mar 10, 2023

This PR adds some important assertions in preparation for the off-thread PR.

  • Assert that we do not leak internals using the publicly available require('node:worker_thread').workerData.
  • Assert that import.meta.resolve is currently available from loader modules (that won't be the case when it's taken off thread).
  • Assert that calling import.meta.resolve using a specifier that returns a never-settling promise exits the process with code 13. (not sure about this one, I think it's better than leaving the process in a dead lock forever, but also code 13 won't make as much sense if there's no longer a top-level await).

//cc @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Mar 10, 2023
@anonrig anonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 10, 2023
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Mar 10, 2023
@github-actions
Copy link
Contributor

Failed to start CI
- Validating Jenkins credentials
✔  Jenkins credentials valid
- Starting PR CI job
✘  Failed to start PR CI: 403 Forbidden
https://github.com/nodejs/node/actions/runs/4385304820

@GeoffreyBooth
Copy link
Member

  • Assert that import.meta.resolve is currently available from loader modules (that won’t be the case when it’s taken off thread).

What does this mean? This PR is testing that import.meta.resolve currently is available within a loader, but we’ll change the assertion to expect the opposite in the off-thread PR?

@aduh95
Copy link
Contributor Author

aduh95 commented Mar 10, 2023

What does this mean? This PR is testing that import.meta.resolve currently is available within a loader, but we’ll change the assertion to expect the opposite in the off-thread PR?

Correct. This should help loader authors who are reviewing the PR understand what has changed with the off-thread PR.

@GeoffreyBooth GeoffreyBooth added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Mar 10, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 10, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 18, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 18, 2023
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@JakobJingleheimer JakobJingleheimer left a comment

Choose a reason for hiding this comment

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

🙌

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 31, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 31, 2023
@nodejs-github-bot nodejs-github-bot merged commit 841f6b3 into nodejs:main Mar 31, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 841f6b3

@RafaelGSS
Copy link
Member

Hi, @aduh95. Could you please create a manual backport for v19.x? It didn't land cleanly because the suite on which the tests were included is the same one that contains:

  it('should work without worker permission', async () => {

which wasn't landed in v19.x.

aduh95 added a commit to aduh95/node that referenced this pull request Apr 5, 2023
PR-URL: nodejs#47033
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
@aduh95 aduh95 added backport-open-v18.x Indicate that the PR has an open backport. and removed backport-open-v19.x labels May 2, 2023
danielleadams pushed a commit that referenced this pull request May 30, 2023
PR-URL: #47033
Backport-PR-URL: #47433
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
abhishekumar-tyagi pushed a commit to abhishekumar-tyagi/node that referenced this pull request May 5, 2024
PR-URL: nodejs/node#47033
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. backport-open-v18.x Indicate that the PR has an open backport. esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants