Skip to content

PYTHON-4610 More robust to_list tests #1773

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

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

ShaneHarvey
Copy link
Member

@async_client_context.require_replica_set
async def test_to_list_tailable(self):
oplog = self.client.local.oplog.rs
last = await oplog.find().sort("$natural", pymongo.DESCENDING).limit(-1).next()
ts = last["ts"]

# Set maxAwaitTimeMS=1 to speed up the test and avoid blocking on the noop writer.
Copy link
Member Author

@ShaneHarvey ShaneHarvey Aug 6, 2024

Choose a reason for hiding this comment

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

maxAwaitTimeMS defaults to 1000, which gives the noop writer a chance to write a document to the oplog. What happens is the to_list call repeatedly calls getMore which blocks for 1 second and returns 1 noop document each time. That's why the test was sometimes taking 20+ seconds.

@ShaneHarvey ShaneHarvey requested review from NoahStapp and removed request for blink1073 August 6, 2024 22:29
@ShaneHarvey ShaneHarvey merged commit da59318 into mongodb:master Aug 6, 2024
34 checks passed
@ShaneHarvey ShaneHarvey deleted the PYTHON-4610 branch August 6, 2024 23:58
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