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

[Build Failure] PyOpenSSL tests are failing logging tests

    • Type: Icon: Build Failure Build Failure
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      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?

      Name of Failure:

      test.test_command_logging.TestCommandLoggingCommand.test_A_failed_command
      test.test_command_logging.TestCommandLoggingCommand.test_A_successful_command
      ... and several others in test_command_logging.

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_tests_pyopenssl__platform~rhel8_auth~auth_ssl~ssl_python_version~3.10_pyopenssl~enabled_test_3.6_replica_set_48d5a46e46e88e337df8cd8ae0fbb77788746e9d_24_04_08_18_34_51/tests?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      Command logging tests expect a certain message size, but when PyOpenSSL is installed the message is truncated.

      Stack trace:

       [2024/04/08 18:29:51.404] FAILURE: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ()
       [2024/04/08 18:29:51.404] self = <test.test_command_logging.TestCommandLoggingServiceId testMethod=test_command_log_messages_omit_serviceId_when_not_in_LB_mode>
       [2024/04/08 18:29:51.404]     def test_case(self):
       [2024/04/08 18:29:51.404] >       self.run_scenario(spec)
       [2024/04/08 18:29:51.404] test/unified_format.py:1914: 
       [2024/04/08 18:29:51.404] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
       [2024/04/08 18:29:51.404] test/unified_format.py:1861: in run_scenario
       [2024/04/08 18:29:51.404]     self._run_scenario(spec, uri)
       [2024/04/08 18:29:51.404] test/unified_format.py:1888: in _run_scenario
       [2024/04/08 18:29:51.404]     self.check_log_messages(spec["operations"], expect_log_messages)
       [2024/04/08 18:29:51.404] test/unified_format.py:1794: in check_log_messages
       [2024/04/08 18:29:51.404]     formatted_logs = format_logs(cm.records)
       [2024/04/08 18:29:51.404] test/unified_format.py:1781: in format_logs
       [2024/04/08 18:29:51.404]     data = json_util.loads(log.message)
       [2024/04/08 18:29:51.404] bson/json_util.py:507: in loads
       [2024/04/08 18:29:51.404]     return json.loads(s, *args, **kwargs)
       [2024/04/08 18:29:51.404] /opt/python/3.10/lib/python3.10/json/__init__.py:359: in loads
       [2024/04/08 18:29:51.404]     return cls(**kw).decode(s)
       [2024/04/08 18:29:51.404] /opt/python/3.10/lib/python3.10/json/decoder.py:337: in decode
       [2024/04/08 18:29:51.404]     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
       [2024/04/08 18:29:51.404] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
       [2024/04/08 18:29:51.404] self = <json.decoder.JSONDecoder object at 0x7f2c7d593b50>
       [2024/04/08 18:29:51.404] s = 'Peer did not staple an OCSP response', idx = 0
       [2024/04/08 18:29:51.404]     def raw_decode(self, s, idx=0):
       [2024/04/08 18:29:51.404]         """Decode a JSON document from ``s`` (a ``str`` beginning with
       [2024/04/08 18:29:51.404]         a JSON document) and return a 2-tuple of the Python
       [2024/04/08 18:29:51.404]         representation and the index in ``s`` where the document ended.
       [2024/04/08 18:29:51.404]     
       [2024/04/08 18:29:51.404]         This can be used to decode a JSON document from a string that may
       [2024/04/08 18:29:51.404]         have extraneous data at the end.
       [2024/04/08 18:29:51.404]     
       [2024/04/08 18:29:51.404]         """
       [2024/04/08 18:29:51.404]         try:
       [2024/04/08 18:29:51.404]             obj, end = self.scan_once(s, idx)
       [2024/04/08 18:29:51.404]         except StopIteration as err:
       [2024/04/08 18:29:51.404] >           raise JSONDecodeError("Expecting value", s, err.value) from None
       [2024/04/08 18:29:51.404] E           json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
       [2024/04/08 18:29:51.404] /opt/python/3.10/lib/python3.10/json/decoder.py:355: JSONDecodeError
      

            Assignee:
            noah.stapp@mongodb.com Noah Stapp
            Reporter:
            steve.silvester@mongodb.com Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: