MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_stale_getmore

Method test_stale_getmore

test/test_client.py:1614–1637  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1612
1613 @client_context.require_replica_set
1614 def test_stale_getmore(self):
1615 # A cursor is created, but its member goes down and is removed from
1616 # the topology before the getMore message is sent. Test that
1617 # MongoClient._run_operation_with_response handles the error.
1618 with self.assertRaises(AutoReconnect):
1619 client = self.rs_client(connect=False, serverSelectionTimeoutMS=100)
1620 client._run_operation(
1621 operation=message._GetMore(
1622 "pymongo_test",
1623 "collection",
1624 101,
1625 1234,
1626 client.codec_options,
1627 ReadPreference.PRIMARY,
1628 None,
1629 client,
1630 None,
1631 None,
1632 False,
1633 None,
1634 ),
1635 unpack_res=Cursor(client.pymongo_test.collection)._unpack_response,
1636 address=("not-a-member", 27017),
1637 )
1638
1639 def test_heartbeat_frequency_ms(self):
1640 class HeartbeatStartedListener(ServerHeartbeatListener):

Callers

nothing calls this directly

Calls 3

CursorClass · 0.90
rs_clientMethod · 0.80
_run_operationMethod · 0.45

Tested by

no test coverage detected