-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5371 - Pass repr(ServerDescription) to logging #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
Conversation
test/asynchronous/test_client.py
Outdated
@@ -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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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 |
pymongo/asynchronous/topology.py
Outdated
previousDescription=initial_td, | ||
newDescription=self._description, | ||
previousDescription=initial_td.__repr__(), | ||
newDescription=self._description.__repr__(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update these to use repr()
instead of __repr__
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Could you update the PR title?
No description provided.