[Build Failure] test_direct_client_maintains_pool_to_arbiter is flaky

XMLWordPrintableJSON

    • Type: Build Failure
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Name of Failure:

      test_direct_client_maintains_pool_to_arbiter

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_pyopenssl_macos_test_standard_rapid_python3.14_sync_noauth_nossl_standalone_patch_ad1167d01ea03780bae1fdb66ddc88283ce9a983_68fb845a5b57f10007a5ff3e_25_10_24_13_52_09/tests?execution=0&sorts=STATUS%3AASC

      Context of when and why the failure occurred:

      Consistently flaky test.

      Stack trace:

       [2025/10/24 07:11:29.821] FAILURE: AssertionError: 0 != 1 ()
       [2025/10/24 07:11:29.821] self = <test.test_client.TestClientPool testMethod=test_direct_client_maintains_pool_to_arbiter>
       [2025/10/24 07:11:29.821]     @client_context.require_connection
       [2025/10/24 07:11:29.821]     def test_direct_client_maintains_pool_to_arbiter(self):
       [2025/10/24 07:11:29.821]         listener = CMAPListener()
       [2025/10/24 07:11:29.821]         c = MockClient.get_mock_client(
       [2025/10/24 07:11:29.821]             standalones=[],
       [2025/10/24 07:11:29.821]             members=["a:1", "b:2", "c:3"],
       [2025/10/24 07:11:29.821]             mongoses=[],
       [2025/10/24 07:11:29.821]             arbiters=["c:3"],  # c:3 is an arbiter.
       [2025/10/24 07:11:29.821]             host="c:3",
       [2025/10/24 07:11:29.821]             directConnection=True,
       [2025/10/24 07:11:29.821]             minPoolSize=1,  # minPoolSize
       [2025/10/24 07:11:29.821]             event_listeners=[listener],
       [2025/10/24 07:11:29.821]         )
       [2025/10/24 07:11:29.821]         self.addCleanup(c.close)
       [2025/10/24 07:11:29.821]     
       [2025/10/24 07:11:29.821]         wait_until(lambda: len(c.nodes) == 1, "connect")
       [2025/10/24 07:11:29.821]         self.assertEqual(c.address, ("c", 3))
       [2025/10/24 07:11:29.821]         # Assert that we create 1 pooled connection.
       [2025/10/24 07:11:29.821]         listener.wait_for_event(monitoring.ConnectionReadyEvent, 1)
       [2025/10/24 07:11:29.821]         self.assertEqual(listener.event_count(monitoring.ConnectionCreatedEvent), 1)
       [2025/10/24 07:11:29.821]         arbiter = c._topology.get_server_by_address(("c", 3))
       [2025/10/24 07:11:29.821] >       self.assertEqual(len(arbiter.pool.conns), 1)
       [2025/10/24 07:11:29.821] E       AssertionError: 0 != 1
       [2025/10/24 07:11:29.821] test/test_client.py:2649: AssertionError
      

            Assignee:
            Noah Stapp
            Reporter:
            Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: