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

Test Failure (PyPy) - test.test_retryable_writes.TestPoolPausedError.test_pool_paused_error_is_retryable

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

      Name of Failure:

      test.test_retryable_writes.TestPoolPausedError.test_pool_paused_error_is_retryable

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_test_rhel8_pypy3.10_cov_no_c_test_latest_sharded_cluster_auth_ssl_sync_async_patch_175481e35d39d851e64441c2121b6c2cf8b335c6_67f552d71ac50700071c6a90_25_04_08_16_46_51?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      Stack trace:

       [2025/04/08 10:20:05.364] FAILURE: AssertionError: ConnectionCheckOutFailedEvent(('localhost', 27017), 'connectionError', 1.0143014899999798) is not an instance of <class 'pymongo.monitoring.PoolClearedEvent'> : [PoolReadyEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364]  ConnectionCheckOutStartedEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364]  ConnectionCreatedEvent(('localhost', 27017), 1),
       [2025/04/08 10:20:05.364]  ConnectionCheckOutStartedEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364]  ConnectionReadyEvent(('localhost', 27017), 1, 0.007096075999925233),
       [2025/04/08 10:20:05.364]  ConnectionCheckedOutEvent(('localhost', 27017), 1, 0.01140949399996316),
       [2025/04/08 10:20:05.364]  ConnectionCheckOutFailedEvent(('localhost', 27017), 'connectionError', 1.0143014899999798),
       [2025/04/08 10:20:05.364]  PoolClearedEvent(('localhost', 27017), None, False),
       [2025/04/08 10:20:05.364]  ConnectionCheckedInEvent(('localhost', 27017), 1),
       [2025/04/08 10:20:05.364]  ConnectionClosedEvent(('localhost', 27017), 1, 'stale'),
       [2025/04/08 10:20:05.364]  PoolReadyEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364]  ConnectionCheckOutStartedEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364]  ConnectionCreatedEvent(('localhost', 27017), 2),
       [2025/04/08 10:20:05.364]  ConnectionCheckOutStartedEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364]  ConnectionReadyEvent(('localhost', 27017), 2, 0.0011694559998431941),
       [2025/04/08 10:20:05.364]  ConnectionCheckedOutEvent(('localhost', 27017), 2, 0.005358937999972113),
       [2025/04/08 10:20:05.364]  ConnectionCheckedInEvent(('localhost', 27017), 2),
       [2025/04/08 10:20:05.364]  ConnectionCheckedOutEvent(('localhost', 27017), 2, 0.009206204000292928),
       [2025/04/08 10:20:05.364]  ConnectionCheckedInEvent(('localhost', 27017), 2)] ()
       [2025/04/08 10:20:05.364] self = <test.test_retryable_writes.TestPoolPausedError testMethod=test_pool_paused_error_is_retryable>
       [2025/04/08 10:20:05.364]     @client_context.require_sync
       [2025/04/08 10:20:05.364]     @client_context.require_failCommand_blockConnection
       [2025/04/08 10:20:05.364]     @client_context.require_retryable_writes
       [2025/04/08 10:20:05.364]     @client_knobs(heartbeat_frequency=0.05, min_heartbeat_interval=0.05)
       [2025/04/08 10:20:05.364]     def test_pool_paused_error_is_retryable(self):
       [2025/04/08 10:20:05.364]         cmap_listener = CMAPListener()
       [2025/04/08 10:20:05.364]         cmd_listener = OvertCommandListener()
       [2025/04/08 10:20:05.364]         client = self.rs_or_single_client(
       [2025/04/08 10:20:05.364]             maxPoolSize=1, event_listeners=[cmap_listener, cmd_listener]
       [2025/04/08 10:20:05.364]         )
       [2025/04/08 10:20:05.364]         for _ in range(10):
       [2025/04/08 10:20:05.364]             cmap_listener.reset()
       [2025/04/08 10:20:05.364]             cmd_listener.reset()
       [2025/04/08 10:20:05.364]             threads = [InsertThread(client.pymongo_test.test) for _ in range(2)]
       [2025/04/08 10:20:05.364]             fail_command = {
       [2025/04/08 10:20:05.364]                 "mode": {"times": 1},
       [2025/04/08 10:20:05.364]                 "data": {
       [2025/04/08 10:20:05.364]                     "failCommands": ["insert"],
       [2025/04/08 10:20:05.364]                     "blockConnection": True,
       [2025/04/08 10:20:05.364]                     "blockTimeMS": 1000,
       [2025/04/08 10:20:05.364]                     "errorCode": 91,
       [2025/04/08 10:20:05.364]                     "errorLabels": ["RetryableWriteError"],
       [2025/04/08 10:20:05.364]                 },
       [2025/04/08 10:20:05.364]             }
       [2025/04/08 10:20:05.364]             with self.fail_point(fail_command):
       [2025/04/08 10:20:05.364]                 for thread in threads:
       [2025/04/08 10:20:05.364]                     thread.start()
       [2025/04/08 10:20:05.364]                 for thread in threads:
       [2025/04/08 10:20:05.364]                     thread.join()
       [2025/04/08 10:20:05.364]                 for thread in threads:
       [2025/04/08 10:20:05.364]                     self.assertTrue(thread.passed)
       [2025/04/08 10:20:05.364]             # It's possible that SDAM can rediscover the server and mark the
       [2025/04/08 10:20:05.364]             # pool ready before the thread in the wait queue has a chance
       [2025/04/08 10:20:05.364]             # to run. Repeat the test until the thread actually encounters
       [2025/04/08 10:20:05.364]             # a PoolClearedError.
       [2025/04/08 10:20:05.364]             if cmap_listener.event_count(ConnectionCheckOutFailedEvent):
       [2025/04/08 10:20:05.364]                 break
       [2025/04/08 10:20:05.364]     
       [2025/04/08 10:20:05.364]         # Via CMAP monitoring, assert that the first check out succeeds.
       [2025/04/08 10:20:05.364]         cmap_events = cmap_listener.events_by_type(
       [2025/04/08 10:20:05.364]             (ConnectionCheckedOutEvent, ConnectionCheckOutFailedEvent, PoolClearedEvent)
       [2025/04/08 10:20:05.364]         )
       [2025/04/08 10:20:05.364]         msg = pprint.pformat(cmap_listener.events)
       [2025/04/08 10:20:05.364]         self.assertIsInstance(cmap_events[0], ConnectionCheckedOutEvent, msg)
       [2025/04/08 10:20:05.364] >       self.assertIsInstance(cmap_events[1], PoolClearedEvent, msg)
       [2025/04/08 10:20:05.364] E       AssertionError: ConnectionCheckOutFailedEvent(('localhost', 27017), 'connectionError', 1.0143014899999798) is not an instance of <class 'pymongo.monitoring.PoolClearedEvent'> : [PoolReadyEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364] E        ConnectionCheckOutStartedEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364] E        ConnectionCreatedEvent(('localhost', 27017), 1),
       [2025/04/08 10:20:05.364] E        ConnectionCheckOutStartedEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364] E        ConnectionReadyEvent(('localhost', 27017), 1, 0.007096075999925233),
       [2025/04/08 10:20:05.364] E        ConnectionCheckedOutEvent(('localhost', 27017), 1, 0.01140949399996316),
       [2025/04/08 10:20:05.364] E        ConnectionCheckOutFailedEvent(('localhost', 27017), 'connectionError', 1.0143014899999798),
       [2025/04/08 10:20:05.364] E        PoolClearedEvent(('localhost', 27017), None, False),
       [2025/04/08 10:20:05.364] E        ConnectionCheckedInEvent(('localhost', 27017), 1),
       [2025/04/08 10:20:05.364] E        ConnectionClosedEvent(('localhost', 27017), 1, 'stale'),
       [2025/04/08 10:20:05.364] E        PoolReadyEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364] E        ConnectionCheckOutStartedEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364] E        ConnectionCreatedEvent(('localhost', 27017), 2),
       [2025/04/08 10:20:05.364] E        ConnectionCheckOutStartedEvent(('localhost', 27017)),
       [2025/04/08 10:20:05.364] E        ConnectionReadyEvent(('localhost', 27017), 2, 0.0011694559998431941),
       [2025/04/08 10:20:05.364] E        ConnectionCheckedOutEvent(('localhost', 27017), 2, 0.005358937999972113),
       [2025/04/08 10:20:05.364] E        ConnectionCheckedInEvent(('localhost', 27017), 2),
       [2025/04/08 10:20:05.364] E        ConnectionCheckedOutEvent(('localhost', 27017), 2, 0.009206204000292928),
       [2025/04/08 10:20:05.364] E        ConnectionCheckedInEvent(('localhost', 27017), 2)]
       [2025/04/08 10:20:05.364] test/test_retryable_writes.py:541: AssertionError
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            noah.stapp@mongodb.com Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: