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

Test Failure - 'LogRecord' object has no attribute 'message'

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.9
    • 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_connection_logging.py::TestConnectionLoggingConnectionPoolOptions::test_Options_should_be_included_in_connection_pool_created_message_when_specified

      Link to task:

      https://github.com/ShaneHarvey/mongo-python-driver/actions/runs/10219973033/job/28279373821

      Context of when and why the failure occurred:

      Stack trace:

      _ TestConnectionLoggingConnectionPoolOptions.test_Options_should_be_included_in_connection_pool_created_message_when_specified _
      
      self = <test.test_connection_logging.TestConnectionLoggingConnectionPoolOptions testMethod=test_Options_should_be_included_in_connection_pool_created_message_when_specified>
      
          def test_case(self):
      >       self.run_scenario(spec)
      
      test/unified_format.py:1940: 
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      test/unified_format.py:1884: in run_scenario
          self._run_scenario(spec, uri)
      test/unified_format.py:1914: in _run_scenario
          self.check_log_messages(spec["operations"], expect_log_messages)
      test/unified_format.py:1815: in check_log_messages
          formatted_logs = format_logs(cm.records)
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      
      log_list = [<LogRecord: pymongo.connection, 10, /home/runner/work/mongo-python-driver/mongo-python-driver/pymongo/logger.py, 88, ...1786177671, "driverConnectionId": 8, "serverConnectionId": 688, "serverHost": "localhost", "serverPort": 27017}">, ...]
      
          def format_logs(log_list):
              client_to_log = defaultdict(list)
              for log in log_list:
                  if log.module == "ocsp_support":
                      continue
      >           data = json_util.loads(log.message)
      E           AttributeError: 'LogRecord' object has no attribute 'message'
      
      test/unified_format.py:1802: AttributeError
      
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            noah.stapp@mongodb.com Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: