Skip to content

PYTHON-5371 - Skip test_continuous_network_errors when debug logs are… #2329

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NoahStapp
Copy link
Contributor

… enabled

@NoahStapp NoahStapp requested a review from blink1073 May 2, 2025 14:38
@@ -1906,6 +1906,7 @@ async def test_direct_connection(self):
with self.assertRaises(ConfigurationError):
AsyncMongoClient(["host1", "host2"], directConnection=True)

@unittest.skipIf(os.environ.get("DEBUG_LOG"), "Enabling debug logs breaks this test")
Copy link
Member

Choose a reason for hiding this comment

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

Why does this test break? I’m concerned about this pattern since it makes it harder to debug the test if it gets skipped. Could we leave a ticket open to come back to this test and make it work in debug mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were planning to replace this test with something less hacky in the future anyway. I can investigate deeper as to why this is breaking if we're planning to keep this test around instead.

@NoahStapp
Copy link
Contributor Author

NoahStapp commented May 2, 2025

Patch build with debug logs enabled without any failures of test_continuous_network_errors: https://spruce.mongodb.com/version/6814e3d321f66a0007561099/tasks?page=0&sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&statuses=failed&taskName=%5E%28%28%3F%21pypy%29.%29%2A%24&variant=%5E%28%28%3F%21pypy%29.%29%2A%24

The fix was to pass ServerDescription.__repr__ instead of actual ServerDescription instances to our SDAM logger.

@NoahStapp NoahStapp requested a review from ShaneHarvey May 2, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants