[Build Failure] TestClientContext.test_must_connect

XMLWordPrintableJSON

    • Type: Build Failure
    • Resolution: Duplicate
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • 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.test_client_context.TestClientContext.test_must_connect

      Link to task:

      https://spruce.corp.mongodb.com/task/mongo_python_driver_pyopenssl_rhel8_test_standard_v7.0_python3.10_sync_auth_ssl_sharded_cluster_min_deps_a706571502fe55e27b0c1645abe75eb881d859cc_26_05_29_18_40_02/tests?execution=0&sorts=STATUS%3AASC

      Context of when and why the failure occurred:

      Started failing on Apr 13, 2026 when the backpressure branch was merged (PYTHON-5668).

      Stack trace:

      [2026/05/30 14:01:14.428] FAILURE: AssertionError: False is not true : client context must be connected when PYMONGO_MUST_CONNECT is set. Failed attempts:
      [2026/05/30 14:01:14.428] failed to connect client MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True, serverselectiontimeoutms=5000): localhost:27017: connection closed (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 5.0s, Topology Description: <TopologyDescription id: 6a1b33dda11b84544b7c001d, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:27017: connection closed (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>
      [2026/05/30 14:01:14.428] failed to connect client MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True, serverselectiontimeoutms=5000, tls=True, tlscertificatekeyfile='/data/mci/8215cedf73a68a9ff24f7fc1b71609e4/drivers-tools/.evergreen/x509gen/client.pem', tlscafile='/data/mci/8215cedf73a68a9ff24f7fc1b71609e4/drivers-tools/.evergreen/x509gen/ca.pem'): 'X509' object has no attribute 'get_extension', Timeout: 5.0s, Topology Description: <TopologyDescription id: 6a1b33e2a11b84544b7c001e, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AttributeError("'X509' object has no attribute 'get_extension'")>]> ()
      [2026/05/30 14:01:14.428] self = <test.test_client_context.TestClientContext testMethod=test_must_connect>
      [2026/05/30 14:01:14.428]     def test_must_connect(self):
      [2026/05/30 14:01:14.428]         if not os.environ.get("PYMONGO_MUST_CONNECT"):
      [2026/05/30 14:01:14.428]             raise SkipTest("PYMONGO_MUST_CONNECT is not set")
      [2026/05/30 14:01:14.428]     
      [2026/05/30 14:01:14.428] >       self.assertTrue(
      [2026/05/30 14:01:14.428]             client_context.connected,
      [2026/05/30 14:01:14.428]             "client context must be connected when "
      [2026/05/30 14:01:14.428]             "PYMONGO_MUST_CONNECT is set. Failed attempts:\n{}".format(
      [2026/05/30 14:01:14.428]                 client_context.connection_attempt_info()
      [2026/05/30 14:01:14.428]             ),
      [2026/05/30 14:01:14.428]         )
      [2026/05/30 14:01:14.428] E       AssertionError: False is not true : client context must be connected when PYMONGO_MUST_CONNECT is set. Failed attempts:
      [2026/05/30 14:01:14.428] E       failed to connect client MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True, serverselectiontimeoutms=5000): localhost:27017: connection closed (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 5.0s, Topology Description: <TopologyDescription id: 6a1b33dda11b84544b7c001d, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:27017: connection closed (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>
      [2026/05/30 14:01:14.428] E       failed to connect client MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True, serverselectiontimeoutms=5000, tls=True, tlscertificatekeyfile='/data/mci/8215cedf73a68a9ff24f7fc1b71609e4/drivers-tools/.evergreen/x509gen/client.pem', tlscafile='/data/mci/8215cedf73a68a9ff24f7fc1b71609e4/drivers-tools/.evergreen/x509gen/ca.pem'): 'X509' object has no attribute 'get_extension', Timeout: 5.0s, Topology Description: <TopologyDescription id: 6a1b33e2a11b84544b7c001e, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AttributeError("'X509' object has no attribute 'get_extension'")>]>
      [2026/05/30 14:01:14.428] test/test_client_context.py:31: AssertionError
      

            Assignee:
            Steve Silvester
            Reporter:
            Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: