PYTHON-5371 - Pass repr(ServerDescription) to logging#2329
PYTHON-5371 - Pass repr(ServerDescription) to logging#2329NoahStapp merged 3 commits intomongodb:masterfrom
Conversation
test/asynchronous/test_client.py
Outdated
| 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.
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.
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.
Could you update these to use repr() instead of __repr__?
ShaneHarvey
left a comment
There was a problem hiding this comment.
LGTM. Could you update the PR title?
No description provided.