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

Fix calling await app.shutdown() in REST API tests #7502

Merged

Conversation

kozlovsky
Copy link
Contributor

As it turns out, many REST API-related test fixtures have an app.shutdown() call at the end instead of await app.shutdown(), and it can be the reason for many problems with test stability.

In this PR, I add a web_app fixture that provides an instance of aiohttp.web_app.Application and correctly calls await app.shutdown() at the end.

The fixture is named web_app and not app to avoid PyCharm confusion with the sphinx.testing.fixtures.app fixture it tries to use when the new fixture is named app.

@kozlovsky kozlovsky requested review from a team and xoriole and removed request for a team June 26, 2023 11:46
Copy link
Contributor

@xoriole xoriole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@kozlovsky kozlovsky merged commit b554579 into Tribler:release/7.13 Jun 26, 2023
15 of 16 checks passed
@kozlovsky kozlovsky deleted the fix/await_app_shutdown_in_tests branch June 26, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants