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

test_web_sendfile_functional isn't testing sendfile #8971

Closed
Dreamsorcerer opened this issue Sep 1, 2024 · 0 comments · Fixed by #9064
Closed

test_web_sendfile_functional isn't testing sendfile #8971

Dreamsorcerer opened this issue Sep 1, 2024 · 0 comments · Fixed by #9064
Labels

Comments

@Dreamsorcerer
Copy link
Member

We have this code in a fixture:

if request.param == "no_sendfile":
asyncio.set_event_loop(loop_without_sendfile)

This looked rather dodgy as it appears, at first glance, to be changing the event loop in the middle of a handler, which you'd expect to break a lot of things.
However, in reality, the loop_without_sendfile fixture modifies the object from the loop fixture, which will be the default loop currently running. Which means that the loop has always been modified and this set_event_loop() call is a no-op.

That means the fixture is causing all the tests to be run twice under the exact same conditions. There is no test case where the sendfile has not been patched out. The fixtures need to be reworked to make this behave correctly, and a regression test for the fixture needs to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant