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(