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: async iife in repl #44878

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tony-go
Copy link
Member

@tony-go tony-go commented Oct 3, 2022

Context

Fixes: #38685

The previous PR has more than ten months, it's why I decided to jump on it.

Improvements

A regression test ensures that async IFEE will work on the REPL.

cc @addaleax

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Oct 3, 2022
Copy link
Contributor

@RaisinTen RaisinTen left a comment

Choose a reason for hiding this comment

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

Should we use Closes or Fixes in the PR description instead of Ref so that merging this PR automatically closes the issue?

'use strict';
require('../common');

// Note: This test ensures that async IIFE doesn't crash
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know the Node.js version for which this test would crash? It only affects debug builds, so it would probably require building Node.js locally for confirming that this is actually a regression test for the issue.

Seeing #38685 (comment) it appears that it got fixed later on, so I'm curious what the fix was.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey @RaisinTen 👋

Honestly I don't have a clue on this :/

Maybe @addaleax could provide the version.

Copy link
Member

@targos targos Nov 8, 2022

Choose a reason for hiding this comment

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

it affected the master branch in May 2021, so I would try with v14.0.0.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @targos :)

Should I checkout the v14 branch and run the test it and see if it fails?

@tony-go
Copy link
Member Author

tony-go commented Feb 8, 2023

Hey 👋🏼

I could not make the test fail on 14.0.0 as advised @targos or with 17.0.0 as mentioned in the issue of @addaleax.

Should I close it so? cc @RaisinTen

@tony-go
Copy link
Member Author

tony-go commented Feb 8, 2023

Nvm, I didn't test with debug build :/

@tony-go
Copy link
Member Author

tony-go commented Feb 8, 2023

I finally build from sources for v14.0.0 and v17.0.0 on mac:

➜  ./node
Welcome to Node.js v14.0.0.
Type ".help" for more information.
> (async() => { })()
Promise { undefined }
>
➜  ./node
Welcome to Node.js v17.0.0.
Type ".help" for more information.
> (async() => { })()
Promise {
  undefined,
  [Symbol(async_id_symbol)]: 26,
  [Symbol(trigger_async_id_symbol)]: 5,
  [Symbol(destroyed)]: { destroyed: false }
}
>

Maybe I should try on my Fedora machine...

@aduh95
Copy link
Contributor

aduh95 commented Sep 20, 2023

@tony-go maybe you can try to spawn a subprocess with --interactive flag instead of using node:repl?

@tony-go
Copy link
Member Author

tony-go commented Sep 21, 2023

@tony-go maybe you can try to spawn a subprocess with --interactive flag instead of using node:repl?

Yeah, good idea @aduh95 :) I just wonder if the PR still makes sense as I was not able to reproduce it: #44878 (comment)

Even if I think that it is sill relevant to have tests anyway? WDYT?

@aduh95
Copy link
Contributor

aduh95 commented Sep 21, 2023

@tony-go what I meant was that maybe you would be able to reproduce on v14.x if you were using -i

@tony-go
Copy link
Member Author

tony-go commented Sep 25, 2023

@tony-go what I meant was that maybe you would be able to reproduce on v14.x if you were using -i

Okay I did not get it this way, but yeah I'll try this :)

@tony-go
Copy link
Member Author

tony-go commented Oct 28, 2023

Hey @aduh95 👋🏼

I could not make it crash on version 14 and the --interactive flag.

:/

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

@jasnell
Copy link
Member

jasnell commented Sep 8, 2024

No updates on this in over a year. Needs to be revisited. Removed the author ready label.

@BridgeAR BridgeAR added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 4, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 4, 2024
@nodejs-github-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Entering async IIFE in REPL triggers DCHECK
8 participants