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

socketTimeoutMS does not work with pyopenssl

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.11
    • Affects Version/s: None
    • Component/s: None
    • Python Drivers
    • Not Needed

      test.test_client.TestClient.test_socket_timeout fails with pyopenssl caused by the changes in PYTHON-4292.

       [2024/12/06 12:22:52.858] FAILURE: AssertionError: NetworkTimeout not raised ()
       [2024/12/06 12:22:52.858] self = <test.test_client.TestClient testMethod=test_socket_timeout>
       [2024/12/06 12:22:52.858]     def test_socket_timeout(self):
       [2024/12/06 12:22:52.858]         no_timeout = self.client
       [2024/12/06 12:22:52.858]         timeout_sec = 1
       [2024/12/06 12:22:52.858]         timeout = self.rs_or_single_client(socketTimeoutMS=1000 * timeout_sec)
       [2024/12/06 12:22:52.858]         self.addCleanup(timeout.close)
       [2024/12/06 12:22:52.858]     
       [2024/12/06 12:22:52.858]         no_timeout.pymongo_test.drop_collection("test")
       [2024/12/06 12:22:52.858]         no_timeout.pymongo_test.test.insert_one({"x": 1})
       [2024/12/06 12:22:52.858]     
       [2024/12/06 12:22:52.858]         # A $where clause that takes a second longer than the timeout
       [2024/12/06 12:22:52.858]         where_func = delay(timeout_sec + 1)
       [2024/12/06 12:22:52.858]     
       [2024/12/06 12:22:52.858]         def get_x(db):
       [2024/12/06 12:22:52.858]             doc = next(db.test.find().where(where_func))
       [2024/12/06 12:22:52.858]             return doc["x"]
       [2024/12/06 12:22:52.858]     
       [2024/12/06 12:22:52.858]         self.assertEqual(1, get_x(no_timeout.pymongo_test))
       [2024/12/06 12:22:52.858] >       with self.assertRaises(NetworkTimeout):
       [2024/12/06 12:22:52.858] E       AssertionError: NetworkTimeout not raised
       [2024/12/06 12:22:52.858] test/test_client.py:1240: AssertionError
      

      https://spruce.mongodb.com/task/mongo_python_driver_pyopenssl_rhel8_pypy3.10_test_4.0_replica_set_auth_ssl_sync_async_a9e61f6bed71dbf9a26d46d18d9905a6a0ccdd16_24_12_02_18_08_52?execution=0&sortBy=STATUS&sortDir=ASC

            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: