test: fix flaky test-resolve-async#17957
Conversation
|
CI: https://ci.nodejs.org/job/node-test-pull-request/12392/ (green) |
ada4921 to
766322d
Compare
|
FWIW, if the |
|
@Trott good point, I think this test actually doesn't need the (I think the reason |
| testResolveAsync().then(common.mustCall(() => { | ||
| called = true; | ||
| })); | ||
| testResolveAsync().then(() => (called = true)); |
There was a problem hiding this comment.
Any reason for the parentheses here instead of the seemingly-more-idiomatic curly braces?
|
|
||
| setTimeout(common.mustCall(() => { assert(called); }), | ||
| common.platformTimeout(20)); | ||
| setTimeout(() => assert(called), common.platformTimeout(50)); |
There was a problem hiding this comment.
My usual comment: I'd prefer the assert(called) be wrapped in curly braces to make it clear that there is no intention of returning a value here. I suspect I'm on the losing end of this particular unimportant style debate. :-P
There was a problem hiding this comment.
I don't have a strong preference so I've gone ahead and changed it.
PR-URL: nodejs#17957 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #17957 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #17957 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #17957 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #17957 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
As I understand it, this test doesn't require theLooks like timeout might be needed after all, let's see if slightly higher setting will do.setTimeoutand can do just fine withsetImmediate.This should fix the flakiness seen in https://ci.nodejs.org/job/node-test-commit-linux/15333/nodes=alpine37-container-x64/tapResults/
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test