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

test: reduce flakiness of test-esm-loader-hooks #49105

Merged
merged 3 commits into from
Aug 12, 2023

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Aug 11, 2023

No description provided.

@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 Aug 11, 2023
@aduh95
Copy link
Contributor Author

aduh95 commented Aug 11, 2023

{data: port2, transferList: [port2]},
);
console.log('register', result);

await import('node:os');
await setTimeout(99); // delay to limit flakiness
Copy link
Member

Choose a reason for hiding this comment

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

isnt this just hiding a bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, race conditions are inherent to cross thread communication I think

Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't a user have to do this too? If so, this feels like a legit bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We've known this since we started working on off-threading the loader hooks, it's documented here:

node/doc/api/esm.md

Lines 740 to 743 in 6ad8318

Hooks are run in a separate thread, isolated from the main. That means it is a
different [realm](https://tc39.es/ecma262/#realm). The hooks thread may be
terminated by the main thread at any time, so do not depend on asynchronous
operations (like `console.log`) to complete.

Copy link
Contributor

@JakobJingleheimer JakobJingleheimer Aug 11, 2023

Choose a reason for hiding this comment

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

OH! Sorry, this is for a console log. Sorry, yes.

Wouldn't it be better to use something not console log then?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe process._rawDebug or fs.writeFileSync(1?

@aduh95
Copy link
Contributor Author

aduh95 commented Aug 11, 2023

The stress test reveals that should have `register` work with cjs is also flaky, working on that

@aduh95

This comment was marked as outdated.

@aduh95
Copy link
Contributor Author

aduh95 commented Aug 11, 2023

@aduh95 aduh95 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 Aug 11, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 11, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@GeoffreyBooth GeoffreyBooth removed the needs-ci PRs that need a full CI run. label Aug 12, 2023
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added needs-ci PRs that need a full CI run. fast-track PRs that do not need to wait for 48 hours to land. labels Aug 12, 2023
@github-actions
Copy link
Contributor

Fast-track has been requested by @aduh95. Please 👍 to approve.

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 12, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 12, 2023
@nodejs-github-bot nodejs-github-bot merged commit e68e359 into nodejs:main Aug 12, 2023
36 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in e68e359

@aduh95 aduh95 deleted the test-esm-loader-hooks-flaky branch August 12, 2023 10:34
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
PR-URL: nodejs#49105
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
PR-URL: nodejs#49105
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 15, 2023
PR-URL: #49105
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Aug 15, 2023
RafaelGSS pushed a commit to RafaelGSS/node that referenced this pull request Aug 15, 2023
PR-URL: nodejs#49105
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
rluvaton pushed a commit to rluvaton/node that referenced this pull request Aug 15, 2023
PR-URL: nodejs#49105
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 16, 2023
PR-URL: #49105
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 17, 2023
PR-URL: #49105
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Nov 11, 2023
PR-URL: nodejs#49105
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@targos targos added the backported-to-v18.x PRs backported to the v18.x-staging branch. label Nov 23, 2023
targos pushed a commit that referenced this pull request Nov 23, 2023
PR-URL: #49105
Backport-PR-URL: #50669
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
PR-URL: nodejs/node#49105
Backport-PR-URL: nodejs/node#50669
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
PR-URL: nodejs/node#49105
Backport-PR-URL: nodejs/node#50669
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
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. backported-to-v18.x PRs backported to the v18.x-staging branch. esm Issues and PRs related to the ECMAScript Modules implementation. fast-track PRs that do not need to wait for 48 hours to land. 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.

7 participants