bluebird
bluebird copied to clipboard
Ability to disable forced serialization of error.stack
- What version of bluebird is the issue happening on?
Most versions since 2.x
- What platform and version? (For example Node.js 0.12 or Google Chrome 32)
All platforms
Bluebird forces serialization of error.stack. In test environments with source maps support (for example, jest) this causes test timeouts since bluebird will attempt to read the stack string, blocking the test up to a few seconds.
Test case to reproduce coming soon - in the mean time I wonder what precisely was the original reason that we forced this serialization.
Previous issues: https://github.com/petkaantonov/bluebird/pull/1285
Are you talking about Promise.coroutine?
No, it seems that bluebird might always be forcing serialization of error.stack - I'm not sure yet. I opened a jest issue too https://github.com/facebook/jest/issues/7879
Forced serialization is to avoid memory leak isn't it?
Yes, but if there was a way to disable it for test environments, it would probably help. There regardless of whether the stack is actually needed if there is a promise error, it gets force-serialized which is really slow with source maps enabled and times out the first test.
I see, could probably create a flag for lazy serialization? PR welcome