Skip to content
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

PYTHON-4815 Migrate test_discovery_and_monitoring.py to async #1893

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

sleepyStick
Copy link
Contributor

No description provided.

@sleepyStick sleepyStick marked this pull request as ready for review October 3, 2024 16:58
@sleepyStick sleepyStick requested a review from NoahStapp October 3, 2024 16:58
@@ -250,7 +250,7 @@ async def _check_server(self) -> ServerDescription:
except (OperationFailure, NotPrimaryError) as exc:
# Update max cluster time even when hello fails.
details = cast(Mapping[str, Any], exc.details)
self._topology.receive_cluster_time(details.get("$clusterTime"))
await self._topology.receive_cluster_time(details.get("$clusterTime"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch!

_IS_SYNC = False

# Location of JSON test specifications.
SDAM_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "discovery_and_monitoring")
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be updated to point to test/discovery_and_monitoring instead of test/asynchronous/discovery_and_monitoring.

else:
raise AssertionError(f"Unknown when field {when}")

topology.handle_error(
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing an await here.

description = phase.get("description", str(i))
with assertion_context(f"phase: {description}"):
for response in phase.get("responses", []):
got_hello(c, common.partition_node(response[0]), response[1])
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing an await here.

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