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 the asyncio wait_for function for the core tests #7771

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

drew2a
Copy link
Contributor

@drew2a drew2a commented Dec 11, 2023

This PR contains refactoring for test_http_get_with_redirect, (in particular, it adds more log output) and it contains an actual fix for the #7767. This refactoring does not fix the problem, but it was a starting point for me to investigate the issue, and I decided to include this change in the PR as it improves logging for the tests and does not clutter the PR too much.

The actual fix is to call patch_wait_for() in conftest.py, as it addresses the issue

which I believe we also have in our tests.

Fixes: #7767

This commit adds logging statements to the magnet redirect server in `test_utilities.py`. The logger is used to log the start and stop of the HTTP server.
…` exception

This commit fixes a bug in the asyncio `wait_for` function where it was swallowing the `CancelledError` exception. The issue was reported in Tribler#7570. The fix involves patching the `wait_for` function to ensure that the exception is not swallowed.
enable_extended_logging = False
pytest_start_time: Optional[datetime] = None # a time when the test suite started

# Fix the asyncio `wait_for` function to not swallow the `CancelledError` exception.
# See: https://github.com/Tribler/tribler/issues/7570
patch_wait_for()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an actual fix.

@drew2a drew2a marked this pull request as ready for review December 11, 2023 15:25
@drew2a drew2a requested review from a team and qstokkink and removed request for a team December 11, 2023 15:25
@drew2a drew2a merged commit 1f57226 into Tribler:main Dec 12, 2023
33 checks passed
@drew2a drew2a deleted the fix/7767 branch December 12, 2023 10:19
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.

Flaky test: test_http_get_with_redirect
2 participants