-
Notifications
You must be signed in to change notification settings - Fork 711
Refactor testing console exporter #2877
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
Conversation
Based on the description in the issue, it sounds like the problem is the test cases are not calling |
We automatically call I think we could configure the All this being said, we should still always use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I think you're right that it's the atexit handler. I'm guessing pytest patches sys.stdout
during the test.
We automatically call
shutdown()
on exit (usingatexit
in theMeterProvider
), so we should not need to callshutdown()
manually.
That is true, but pytest runs all of the test in a single process. So anything that happens in a test that doesn't get torn down will leak into all the tests. E.g. each PeriodicExportingMetricReader instance has a background thread which will leak and could really slow down our tests. I guess this is a separate issue from this one though.
opentelemetry-sdk/tests/metrics/integration_test/test_console_exporter.py
Outdated
Show resolved
Hide resolved
Good point, but I agree this is another issue for another PR. |
d5243bc
to
952253f
Compare
This test is failing in CI (but not in my laptop 🙄). Marking this PR as draft while I investigate this. |
Fixes #2876