-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
async_hooks: Adding regression test case for async/await #22374
Conversation
@@ -0,0 +1,25 @@ | |||
'use strict'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a require('../common')
as the first require
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it would be helpful to have a comment in here that explains what this is testing for.
}).enable(); | ||
|
||
async function main() { | ||
console.log('hello'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the console.log()
statements are not required, then let's not have them. If they are required for the test, please add a comment so folks don't remove them
Refs: #20467 |
@BridgeAR Oops, didn't notice that there was a PR already and got closed. May be I can back-port the same testing file here? |
@BridgeAR I just ran the test file https://raw.githubusercontent.com/BridgeAR/node/da7eaa8ef0fac2444f6892753c9db5cae39f6e1a/test/parallel/test-async-hooks-async-await-regression.js, looks like test is failing. |
37a3022
to
bb0b7b4
Compare
Thanks @jasnell, addressed your comments. @BridgeAR I'm not really sure why the test case that you have written over here : https://raw.githubusercontent.com/BridgeAR/node/da7eaa8ef0fac2444f6892753c9db5cae39f6e1a/test/parallel/test-async-hooks-async-await-regression.js, fails. But the test case included in this PR is working fine. Also, I ran same on node version 9 too (as the original issue claimed it stopped working from version 10). Things looks good to me. Note: Test case from this PR: #20467, even fails on node version 9. |
@antsmartian don't worry. I am not sure about the test anymore. It has been a while. As far as I remember the console.log did have a purpose though. @bmeurer @MayaLekova PTAL |
2dcdd60
to
5985e16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR needs a rebase against master to avoid the git failure in the CI. |
@joyeecheung Taken care. |
// asyncIds & triggerAsyncId for async-await | ||
'use strict'; | ||
|
||
const common = require('../common'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint issue: the common
is never used. Just make this...
require('./common');
without assigning it to anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasnell: Taken care also, rebased with master. So CI should be green now.
748c41b
to
8f4ad83
Compare
(the previous one is an infra failure and I doubt it will be resumable) |
@nodejs/build this is blocked on nodejs/build#1469. |
Landed in c8a27a7 |
Thanks @mcollina |
You are welcome! |
This #20274 (comment) is fixed by V8 update. This PR adds a regression test case.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes