dd-trace-js
dd-trace-js copied to clipboard
fix: flush tracer after jest environment is torn down
What does this PR do?
It flushes the tracer after jest environment is torn down instead of delaying the teardown.
Motivation
Fixes issues with error boundaries in React like #1945
Is there any way to test for the side effects that the current approach could cause to avoid regressions in the future?
cc @juan-fernandez
hi @sokki ! Thanks for this contribution. This looks like a good idea. Let me run some tests and try to come up with a test case and I'll get back to you.
Is there any way to test for the side effects that the current approach could cause to avoid regressions in the future?
@sokki's colleague here. So, we tried making a minimal reproducible example here, but we were not able to do so without pulling in the entirety of React and React Testing Library. There is the minimal reproduction repository that @sokki created, but that's all we got for now.
We can't quite figure out the root cause for this issue, just that flushing the tracer after the jest environment has been torn down fixes the issue.
this should not be relevant anymore :)