Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-5173

Test Failure - test_continuous_network_errors

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.12
    • Affects Version/s: None
    • Component/s: greenerbuild
    • None
    • Python Drivers
    • Not Needed

      test_continuous_network_errors is failing more often starting today, for example:

       [2025/02/28 13:34:37.039] __________________ TestClient.test_continuous_network_errors ___________________
       [2025/02/28 13:34:37.039] self = <test.test_client.TestClient testMethod=test_continuous_network_errors>
       [2025/02/28 13:34:37.039]     @unittest.skipIf("PyPy" in sys.version, "PYTHON-2927 fails often on PyPy")
       [2025/02/28 13:34:37.039]     def test_continuous_network_errors(self):
       [2025/02/28 13:34:37.039]         def server_description_count():
       [2025/02/28 13:34:37.039]             i = 0
       [2025/02/28 13:34:37.039]             for obj in gc.get_objects():
       [2025/02/28 13:34:37.039]                 try:
       [2025/02/28 13:34:37.039]                     if isinstance(obj, ServerDescription):
       [2025/02/28 13:34:37.039]                         i += 1
       [2025/02/28 13:34:37.039]                 except ReferenceError:
       [2025/02/28 13:34:37.039]                     pass
       [2025/02/28 13:34:37.039]             return i
       [2025/02/28 13:34:37.039]         gc.collect()
       [2025/02/28 13:34:37.039]         with client_knobs(min_heartbeat_interval=0.003):
       [2025/02/28 13:34:37.039]             client = self.simple_client(
       [2025/02/28 13:34:37.039]                 "invalid:27017", heartbeatFrequencyMS=3, serverSelectionTimeoutMS=150
       [2025/02/28 13:34:37.039]             )
       [2025/02/28 13:34:37.039]             initial_count = server_description_count()
       [2025/02/28 13:34:37.039]             with self.assertRaises(ServerSelectionTimeoutError):
       [2025/02/28 13:34:37.039]                 client.test.test.find_one()
       [2025/02/28 13:34:37.039]             gc.collect()
       [2025/02/28 13:34:37.039]             final_count = server_description_count()
       [2025/02/28 13:34:37.039]             # If a bug like PYTHON-2433 is reintroduced then too many
       [2025/02/28 13:34:37.039]             # ServerDescriptions will be kept alive and this test will fail:
       [2025/02/28 13:34:37.039]             # AssertionError: 19 != 46 within 15 delta (27 difference)
       [2025/02/28 13:34:37.039]             # On Python 3.11 we seem to get more of a delta.
       [2025/02/28 13:34:37.039] >           self.assertAlmostEqual(initial_count, final_count, delta=20)
       [2025/02/28 13:34:37.039] E           AssertionError: 46 != 24 within 20 delta (22 difference)
       [2025/02/28 13:34:37.039] test/test_client.py:1820: AssertionError
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: