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

[Build Failure] Green Framework Tests Failing Logging

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.7
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed
    • 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 other test_command_logging tests.

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_green_framework_rhel8__platform~rhel8_auth_ssl~auth_ssl_python_version~3.10_green_framework~eventlet_test_3.6_replica_set_48d5a46e46e88e337df8cd8ae0fbb77788746e9d_24_04_08_18_34_51?execution=0&sortBy=STATUS&sortDir=ASC
      https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_green_framework_rhel8__platform~rhel8_auth_ssl~auth_ssl_python_version~3.10_green_framework~gevent_test_3.6_replica_set_48d5a46e46e88e337df8cd8ae0fbb77788746e9d_24_04_08_18_34_51?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      Command logging tests from PYTHON-3113 expect a certain message size, but when a green framework is installed the message is truncated.

      Stack trace:

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

            Assignee:
            steve.silvester@mongodb.com Steve Silvester
            Reporter:
            steve.silvester@mongodb.com Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: