Skip to content
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

Some psycopg async tests don't run #2539

Closed
xrmx opened this issue May 22, 2024 · 2 comments · Fixed by #2540
Closed

Some psycopg async tests don't run #2539

xrmx opened this issue May 22, 2024 · 2 comments · Fixed by #2540
Labels
bug Something isn't working

Comments

@xrmx
Copy link
Contributor

xrmx commented May 22, 2024

Describe your environment

Steps to reproduce

tox -e py310-test-instrumentation-psycopg

What is the expected behavior?

No warnings

What is the actual behavior?

instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py::TestPostgresqlIntegration::test_instrumentor_with_async_connection_class
  /usr/lib/python3.10/unittest/case.py:549: RuntimeWarning: coroutine 'TestPostgresqlIntegration.test_instrumentor_with_async_connection_class' was never awaited
    method()
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py::TestPostgresqlIntegration::test_not_recording_async
  /usr/lib/python3.10/unittest/case.py:549: RuntimeWarning: coroutine 'TestPostgresqlIntegration.test_not_recording_async' was never awaited
    method()
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py::TestPostgresqlIntegration::test_span_name_async
  /usr/lib/python3.10/unittest/case.py:549: RuntimeWarning: coroutine 'TestPostgresqlIntegration.test_span_name_async' was never awaited
    method()
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py::TestPostgresqlIntegration::test_wrap_async_connection_class_with_cursor
  /usr/lib/python3.10/unittest/case.py:549: RuntimeWarning: coroutine 'TestPostgresqlIntegration.test_wrap_async_connection_class_with_cursor' was never awaited
    method()
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

Additional context

This is not psycopg specific, asyncpg tests had the same issue in running async tests. So once a solution is found we should probably apply it in more places.

@xrmx xrmx added the bug Something isn't working label May 22, 2024
@aabmass
Copy link
Member

aabmass commented May 22, 2024

I also noticed that pytest-asyncio is sometimes not installed which is supposed to handle these https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-python-contrib%20pytest.mark.asyncio&type=code

Maybe we can move all of those to use IsolatedAsyncioTestCase as well

@xrmx
Copy link
Contributor Author

xrmx commented May 23, 2024

@aabmass Done, removed pytest-asyncio markers and dependencies from grpc that didn't need them. Double checked the very same number of tests is run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants