Skip to content

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Mar 13, 2025

PYTHON-5208 Add spec test for wait queue timeout errors do not clear the pool

Implementation of mongodb/specifications#1768

@ShaneHarvey ShaneHarvey changed the title PYTHON-5202 Add spec test for wait queue timeout errors do not clear the pool PYTHON-5208 Add spec test for wait queue timeout errors do not clear the pool Mar 13, 2025
@ShaneHarvey ShaneHarvey marked this pull request as ready for review April 2, 2025 21:00
self._cluster_time = (await self.client.admin.command("ping")).get("$clusterTime")
await self.entity_map.advance_cluster_times()
self._cluster_time = self.client._topology.max_cluster_time()
await self.entity_map.advance_cluster_times(self._cluster_time)
Copy link
Member Author

Choose a reason for hiding this comment

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

I refactored this to remove the "ping" command because it was causing problems with the failpoint for this new test. We can get the clusterTime via self.client._topology.max_cluster_time() instead.

@ShaneHarvey ShaneHarvey requested a review from NoahStapp April 3, 2025 18:11
await self.entity_map.create_entities_from_spec(
self.TEST_SPEC.get("createEntities", []), uri=uri
)
self._cluster_time = None
Copy link
Contributor

@NoahStapp NoahStapp Apr 3, 2025

Choose a reason for hiding this comment

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

nit: Do we need to store this at the class level at all, or can this be a fully local variable?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we need it because the spec says it's the clusterTime from directly after initialData is inserted.

Copy link
Member Author

Choose a reason for hiding this comment

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

the test runner MUST advance the cluster time of any session entities created during the test using the cluster time collected from processing initialData. See MigrationConflict Errors on Sharded Clusters for more information.

@ShaneHarvey ShaneHarvey merged commit 8b66889 into mongodb:master Apr 3, 2025
34 of 37 checks passed
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