-
Notifications
You must be signed in to change notification settings - Fork 819
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
Experimental grpc plugin async onInit conflicts with testing norms #4266
Comments
Also seeing this. Let me know if I can provide more info! Everything I would say appears to be captured in the parent comment. |
Possibly related: some of my (fully unrelated) unit tests are failing with the following message:
|
I stand corrected, the above message was likely caused by a change in how my team ran tests. Disregard. |
ya, get that all of the time. same general issue as discussed in the root report |
is there any fix? What I found was to mock opentelemetry in all the test cases. But that is not the feasible solution. |
@charandazn #4432 should include a fix for this. It loads |
What happened?
Steps to Reproduce
jest
test that sets up instrumentation usingopentelemetry/otlp-grpc-exporter-base
e.g.
Expected Result
No error.
Actual Result
Error.
Additional Details
onInit
is modeled as a sync function--however, it is certainly async. it's worth considering moving the that dyn require to a dyn import and tracking the control flow versus onInit being purely a side effect.in other words:
onInit: () => void
=>onInit: () => Promise<void>
, and changing the upstream callee patterns as needed.Otherwise, in all of our integration tests, we must mock out a transitive dependency (the OT libs) just to not crash the test runner.
OpenTelemetry Setup Code
package.json
Relevant log output
The text was updated successfully, but these errors were encountered: