From 015073d4c17fbef01d3b31ced413825f59fe1f2e Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Tue, 17 Oct 2023 10:55:18 -0700 Subject: [PATCH] =?UTF-8?q?PYTHON-3988=20Python=20Test=20Suite=20still=20u?= =?UTF-8?q?ses=20legacy=20isMaster=20Command=20when=E2=80=A6=20(#1395)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/__init__.py b/test/__init__.py index 9792504a5..5abca5a18 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -307,7 +307,10 @@ class ClientContext: @property def hello(self): if not self._hello: - self._hello = self.client.admin.command(HelloCompat.LEGACY_CMD) + if self.serverless or self.load_balancer: + self._hello = self.client.admin.command(HelloCompat.CMD) + else: + self._hello = self.client.admin.command(HelloCompat.LEGACY_CMD) return self._hello def _connect(self, host, port, **kwargs): @@ -317,7 +320,7 @@ class ClientContext: ) try: try: - client.admin.command(HelloCompat.LEGACY_CMD) # Can we connect? + client.admin.command("ping") # Can we connect? except pymongo.errors.OperationFailure as exc: # SERVER-32063 self.connection_attempts.append(