Skip to content

Commit 015073d

Browse files
authored
PYTHON-3988 Python Test Suite still uses legacy isMaster Command when… (#1395)
1 parent 4fa6056 commit 015073d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ def uri(self):
307307
@property
308308
def hello(self):
309309
if not self._hello:
310-
self._hello = self.client.admin.command(HelloCompat.LEGACY_CMD)
310+
if self.serverless or self.load_balancer:
311+
self._hello = self.client.admin.command(HelloCompat.CMD)
312+
else:
313+
self._hello = self.client.admin.command(HelloCompat.LEGACY_CMD)
311314
return self._hello
312315

313316
def _connect(self, host, port, **kwargs):
@@ -317,7 +320,7 @@ def _connect(self, host, port, **kwargs):
317320
)
318321
try:
319322
try:
320-
client.admin.command(HelloCompat.LEGACY_CMD) # Can we connect?
323+
client.admin.command("ping") # Can we connect?
321324
except pymongo.errors.OperationFailure as exc:
322325
# SERVER-32063
323326
self.connection_attempts.append(

0 commit comments

Comments
 (0)