-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Node 16.2.0 with Jest break AsyncLocalStorage #49
Comments
@puzpuzpuz Maybe you have any ideas what could be wrong? Wasn't nodejs/node#36394 supposed to be a non-breaking change? |
I would recommend opening this on Node.js |
@Qard can you take a look? |
I'll try to find some time to look at it soon. Just got vaccinated yesterday so I'm a bit out of commission today. 😷 |
Looks like probably the same issue as was discovered in DataDog/dd-trace-js#1095, which seems to be only producible when running in Node.js 16.2.0 and jest. I'll try to find some time to copy/paste the tests into vanilla scripts without jest possibly tomorrow to verify. |
Got a bit of time to try it before bed and as I thought, it only happens within Jest. So Jest must be doing something different. Not sure what. 🤔 |
Yes, it supposed to be a non-breaking change. And I can also see test failures in https://github.com/puzpuzpuz/cls-rtracer + node v16.2.0 which uses jest. |
The short term fix is to migrate off Jest. It's a good thing to do anyway. (Jest does an absurd amount of monkeypatching of core, so any internal change is likely to break them). |
@mcollina Yes, I'm thinking about rewriting tests in TAP. The only concern that I have is that Jest is a very popular framework, and if |
@puzpuzpuz Gotcha, thank you for the clarification! |
I posted a reproduction of the issue that doesn't use Jest here: nodejs/node#38577 (comment) |
It looks like a fix should land in Node 16.3.0. |
Confirmed, 16.3.0 resolves the issue. |
Prerequisites
Fastify version
3.x.x
Node.js version
16.2.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
Linux, Windows, doesn't matter
Description
All tests are failing when being run on Node 16.2.0. Seems like all stored values are lost and are being resolved to
undefined
.Considering that tests for https://github.com/kibertoad/asynchronous-local-storage are still passing with 16.2.0, looks like this particular plugin is doing something wrong.
Steps to Reproduce
Execute existing test suite on Node 16.2.0
Expected Behavior
Test suite passes.
The text was updated successfully, but these errors were encountered: