fix: handle open handles from inside tests - #6263
Conversation
|
|
||
| const stacks = new Set(); | ||
|
|
||
| const uniqueErrors = formatted.filter(handle => { |
There was a problem hiding this comment.
Any difference about Timeout and TIMERWRAP?
There was a problem hiding this comment.
IDK. TIMEWRAP is a libuv thing, that's what I got from googling it. I don't think it really matters, they point to the same thing
There was a problem hiding this comment.
Or maybe we can just ditch the filtering?
There was a problem hiding this comment.
Can you just add a comment about the dupes? Should be good enough
| // We make *all* functions async and run `done` right away if they | ||
| // didn't return a promise. | ||
| const asyncFn = function(done) { | ||
| const asyncJestLifecycle = function(done) { |
|
Some weird errors happening on Node 10 |
|
Yeah, node 10.2.0 is messed up. nodejs/node#20921 |
3d28fb1 to
24606f3
Compare
|
I need to fix this for circus |
a92dae2 to
fed0667
Compare
d419c93 to
f65ed9e
Compare
| if (error.stack.includes('Runtime.requireModule')) { | ||
| if ( | ||
| error.stack.includes('Runtime.requireModule') || | ||
| (error.stack.includes('callAsyncCircusFn') && |
There was a problem hiding this comment.
shouldn't this be || instead of &&?
There was a problem hiding this comment.
I pushed a new commit extracting this into a function where I think the logic (that doesn't really work...) is easier to follow
|
wouldn't this always be triggered from somewhere in user's code though? |
|
|
||
| // E.g. timeouts might give multiple traces to the same line of code | ||
| // This hairy filtering tries to remove entries with duplicate stack traces | ||
| const uniqueErrors = formatted.filter(handle => { |
There was a problem hiding this comment.
should we exatract this into a separate module?
i a little worried about introducing so much complex logic right in index.js :P
Basically, we track absolutely everything async happening in the process. But a lot of async stuff is expected such as triggering |
|
@SimenB can we attach an extra flag to it when we trigger them? |
7eadb3d to
7756068
Compare
|
Good point, that might actually solve my issue. That's awesome. I'll rebase after it lands 🙂 |
7756068 to
860e923
Compare
|
Rebased, and looks good locally |
|
Hmm, for some reason this timeout is reported on CI, but not locally: https://github.com/facebook/jest/blob/c0819fc0c39dc3e7bc20513963678894e5bae6ab/packages/jest-circus/src/utils.js#L175-L178 |
|
|
|
Green! 🎉 |
This reverts commit 176a9c1.
|
🎉 |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |



Summary
@thymikee found this one before the tweet storm yesterday 😅
Test plan
Added test