dd-trace-js icon indicating copy to clipboard operation
dd-trace-js copied to clipboard

fix: flush tracer after jest environment is torn down

Open sokki opened this issue 3 years ago • 3 comments

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

sokki avatar Mar 30 '22 15:03 sokki

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

rochdev avatar Mar 30 '22 15:03 rochdev

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.

juan-fernandez avatar Mar 30 '22 15:03 juan-fernandez

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.

mausworks avatar Mar 30 '22 16:03 mausworks

this should not be relevant anymore :)

juan-fernandez avatar Aug 16 '23 07:08 juan-fernandez