test.test_topology.TestTopologyErrors.test_pool_reset is flakey on PyPy

XMLWordPrintableJSON

    • Type: Build Failure
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: greenerbuild
    • None
    • None
    • Python Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Name of Failure:

      test.test_topology.TestTopologyErrors.test_pool_reset

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_storage_inmemory_rhel8_test_standard_v8.0_pypy3.10_sync_noauth_nossl_standalone_patch_0ec57781d14160531887f61e4edf083acbef7686_681381615446a6000796e325_25_05_01_14_13_15?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      N/A.

      Stack trace:

       [2025/05/01 07:21:42.468] FAILURE: AssertionError: 0 == 0 ()
       [2025/05/01 07:21:42.468] self = <test.test_topology.TestTopologyErrors testMethod=test_pool_reset>
       [2025/05/01 07:21:42.468]     def test_pool_reset(self):
       [2025/05/01 07:21:42.468]         # hello succeeds at first, then always raises socket error.
       [2025/05/01 07:21:42.468]         hello_count = [0]
       [2025/05/01 07:21:42.468]     
       [2025/05/01 07:21:42.468]         class TestMonitor(Monitor):
       [2025/05/01 07:21:42.468]             def _check_with_socket(self, *args, **kwargs):
       [2025/05/01 07:21:42.468]                 hello_count[0] += 1
       [2025/05/01 07:21:42.468]                 if hello_count[0] == 1:
       [2025/05/01 07:21:42.468]                     return Hello({"ok": 1, "maxWireVersion": common.MIN_SUPPORTED_WIRE_VERSION}), 0
       [2025/05/01 07:21:42.468]                 else:
       [2025/05/01 07:21:42.468]                     raise AutoReconnect("mock monitor error")
       [2025/05/01 07:21:42.468]     
       [2025/05/01 07:21:42.468]         t = create_mock_topology(monitor_class=TestMonitor)
       [2025/05/01 07:21:42.468]         self.addCleanup(t.close)
       [2025/05/01 07:21:42.468]         server = wait_for_primary(t)
       [2025/05/01 07:21:42.468]         self.assertEqual(1, hello_count[0])
       [2025/05/01 07:21:42.468]         generation = server.pool.gen.get_overall()
       [2025/05/01 07:21:42.468]     
       [2025/05/01 07:21:42.468]         # Pool is reset by hello failure.
       [2025/05/01 07:21:42.468]         t.request_check_all()
       [2025/05/01 07:21:42.468] >       self.assertNotEqual(generation, server.pool.gen.get_overall())
       [2025/05/01 07:21:42.468] E       AssertionError: 0 == 0
       [2025/05/01 07:21:42.468] test/test_topology.py:773: AssertionError
      

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

              Created:
              Updated: