-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-2928 Fix mod_wsgi test failures #750
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
@@ -41,7 +41,7 @@ ndocs = 20 | |||
|
|||
collection.drop() | |||
collection.insert_many([{'i': i} for i in range(ndocs)]) | |||
client.close() # Discard main thread's request socket. |
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.
I understand why removing this line fixes the test failure but is this line important? It claims to be discarding the "main thread's request socket" which seems like it might be important for the test. This was added in https://jira.mongodb.org/browse/PYTHON-353. Reading through that issue might give a clue.
I suggest we err on the side of caution and do this:
client = MongoClient()
collection = client.test.test
ndocs = 20
collection.drop()
collection.insert_many([{'i': i} for i in range(ndocs)])
client.close() # Discard main thread's request socket.
client = MongoClient()
collection = client.test.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.
Done.
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.
Can you also remove the "# If the deployment is a replica set, connect to the whole set." part like I did in my example? It's no longer needed after PYTHON-2679 (Auto discover replica sets by default).
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.
Done.
Please schedule the mod_wsgi test tasks in the latest patch build (https://spruce.mongodb.com/version/615ce0f31e2d175df43cc025) |
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
No description provided.