Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#32614 closed Bug (fixed)

MiddlewareSyncAsyncTests crashes with asgiref 3.3.2.

Reported by: Chris Jerdonek Owned by: Mariusz Felisiak
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Andrew Godwin, Carlton Gibson Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Chris Jerdonek)

I see the following test failing on a recent PR: middleware_exceptions.tests.MiddlewareSyncAsyncTests.test_async_process_template_response_returns_none_with_sync_client
https://djangoci.com/job/pr-mariadb/database=mysql,label=mariadb,python=python3.9/10979/

It looks like it might be because of the 3.3.2 asgiref release, since that was released today:
https://github.com/django/asgiref/
and the failure is unrelated to what the PR changed.

I also see the same failure on a different recent PR:
https://djangoci.com/job/pull-requests-bionic/database=mysql,label=bionic-pr,python=python3.8/11081/

Change History (11)

comment:1 by Chris Jerdonek, 4 years ago

Description: modified (diff)

comment:2 by Chris Jerdonek, 4 years ago

I flagged it in asgiref's tracker: https://github.com/django/asgiref/issues/250

comment:3 by Mariusz Felisiak, 4 years ago

Summary: MiddlewareSyncAsyncTests test failure due to 3.3.2 asgiref release?MiddlewareSyncAsyncTests crashes with asgiref 3.3.2.
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

comment:4 by Mariusz Felisiak, 4 years ago

Cc: Andrew Godwin Carlton Gibson added

comment:5 by Mariusz Felisiak, 4 years ago

Owner: changed from nobody to Mariusz Felisiak
Status: newassigned

comment:6 by Mariusz Felisiak, 4 years ago

Has patch: set

comment:7 by GitHub <noreply@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 78fea27f:

Fixed #32614 -- Fixed MiddlewareSyncAsyncTests tests with asgiref 3.3.2+.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In eb7c0a70:

[3.2.x] Fixed #32614 -- Fixed MiddlewareSyncAsyncTests tests with asgiref 3.3.2+.

Backport of 78fea27f690028204c03c28d821cb0c0240a7398 from main

comment:9 by Chris Jerdonek, 4 years ago

Are the committed changes still needed with the fix that was deployed to asgiref in 3.3.3? If not, would it be cleaner to revert those?

comment:10 by Andrew Godwin, 4 years ago

I would encourage them to be kept as the middleware should also be marked as an async function, regardless or not of how good asgiref is now at determining if something is async or not.

in reply to:  9 comment:11 by Mariusz Felisiak, 4 years ago

Replying to Chris Jerdonek:

Are the committed changes still needed with the fix that was deployed to asgiref in 3.3.3? If not, would it be cleaner to revert those?

Yes, this is a separate issue. Django on the main branch doesn't support Python < 3.8, so the fix in asgiref doesn't affect it.

Note: See TracTickets for help on using tickets.
Back to Top