opentracing-contrib / python-django

OpenTracing instrumentation for the Django framework
BSD 3-Clause "New" or "Revised" License
105 stars 54 forks source link

Django 4.1 all tests fail with 'OpenTracingMiddleware' object has no attribute '_is_coroutine' #71

Open jayvdb opened 2 years ago

jayvdb commented 2 years ago
[   37s] ERROR: test_middleware_untraced_no_trace_all (test_site.test_middleware.TestDjangoOpenTracingMiddleware)
[   37s] ----------------------------------------------------------------------
[   37s] Traceback (most recent call last):
[   37s]   File "/usr/lib/python3.8/site-packages/django/test/utils.py", line 460, in inner
[   37s]     return func(*args, **kwargs)
[   37s]   File "/home/abuild/rpmbuild/BUILD/python-django-1.1.0/tests/test_site/test_middleware.py", line 37, in test_middleware_untraced_no_trace_all
[   37s]     response = client.get('/untraced/')
[   37s]   File "/usr/lib/python3.8/site-packages/django/test/client.py", line 836, in get
[   37s]     response = super().get(path, data=data, secure=secure, **extra)
[   37s]   File "/usr/lib/python3.8/site-packages/django/test/client.py", line 424, in get
[   37s]     return self.generic(
[   37s]   File "/usr/lib/python3.8/site-packages/django/test/client.py", line 541, in generic
[   37s]     return self.request(**r)
[   37s]   File "/usr/lib/python3.8/site-packages/django/test/client.py", line 810, in request
[   37s]     self.check_exception(response)
[   37s]   File "/usr/lib/python3.8/site-packages/django/test/client.py", line 663, in check_exception
[   37s]     raise exc_value
[   37s]   File "/usr/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
[   37s]     response = get_response(request)
[   37s]   File "/usr/lib/python3.8/site-packages/django/utils/deprecation.py", line 131, in __call__
[   37s]     if self._is_coroutine:
[   37s] AttributeError: 'OpenTracingMiddleware' object has no attribute '_is_coroutine'
[   37s] 
oscarhermoso commented 2 years ago

@jayvdb Code has been fixed but is unreleased: https://github.com/census-instrumentation/opencensus-python/pull/1159

I've left a comment with a temp patch here: https://github.com/census-instrumentation/opencensus-python/pull/1159#issuecomment-1279893833