Skip to content

Conversation

juliusgeo
Copy link
Contributor

No description provided.

@@ -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.
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@ShaneHarvey ShaneHarvey Oct 5, 2021

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@ShaneHarvey
Copy link
Member

Please schedule the mod_wsgi test tasks in the latest patch build (https://spruce.mongodb.com/version/615ce0f31e2d175df43cc025)

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

LGTM

@juliusgeo juliusgeo merged commit dd9206a into mongodb:master Oct 6, 2021
juliusgeo added a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 5, 2022
juliusgeo added a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 7, 2022
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