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

[BuildFailure] TestCommandLoggingRedactedCommands

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

      Name of Failure:

      test.test_command_logging.TestCommandLoggingRedactedCommands.test_hello_without_speculative_authenticate_command_and_server_reply_are_not_redacted
      test.test_command_logging.TestCommandLoggingRedactedCommands.test_legacy_hello_without_speculative_authenticate_command_and_server_reply_are_not_redacted

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_rhel8_test_ssl__platform~rhel8_auth_ssl~noauth_nossl_python_version~3.7_coverage~coverage_test_7.0_replica_set_266b3dd8e97a18884e5fb2261e1577f7b451df1b_24_03_07_22_53_09/tests?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      We need to increase the truncation limit to avoid randomly getting truncated, since the unified tests rely on a decoded JSON document.

      Stack trace:

       [2024/03/07 17:06:46.874] FAILURE: json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 995 (char 994) ()
       [2024/03/07 17:06:46.874] self = <test.test_command_logging.TestCommandLoggingRedactedCommands testMethod=test_hello_without_speculative_authenticate_command_and_server_reply_are_not_redacted>
       [2024/03/07 17:06:46.874]     def test_case(self):
       [2024/03/07 17:06:46.874] >       self.run_scenario(spec)
       [2024/03/07 17:06:46.874] test/unified_format.py:1854: 
       [2024/03/07 17:06:46.874] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
       [2024/03/07 17:06:46.874] test/unified_format.py:1801: in run_scenario
       [2024/03/07 17:06:46.874]     self._run_scenario(spec, uri)
       [2024/03/07 17:06:46.874] test/unified_format.py:1828: in _run_scenario
       [2024/03/07 17:06:46.874]     self.check_log_messages(spec["operations"], expect_log_messages)
       [2024/03/07 17:06:46.874] test/unified_format.py:1762: in check_log_messages
       [2024/03/07 17:06:46.874]     self.match_evaluator.match_result(expected_data, actual_data)
       [2024/03/07 17:06:46.874] test/unified_format.py:791: in match_result
       [2024/03/07 17:06:46.874]     return self._match_document(expectation, actual, is_root=not in_recursive_call)
       [2024/03/07 17:06:46.874] test/unified_format.py:776: in _match_document
       [2024/03/07 17:06:46.874]     if self._evaluate_if_special_operation(expectation, actual, key):
       [2024/03/07 17:06:46.874] test/unified_format.py:764: in _evaluate_if_special_operation
       [2024/03/07 17:06:46.874]     opname=opname, spec=spec, actual=actual, key_to_compare=key_to_compare
       [2024/03/07 17:06:46.874] test/unified_format.py:728: in _evaluate_special_operation
       [2024/03/07 17:06:46.874]     method(spec, actual, key_to_compare)
       [2024/03/07 17:06:46.874] test/unified_format.py:716: in _operation_matchAsDocument
       [2024/03/07 17:06:46.874]     self._match_document(spec, json_util.loads(actual[key_to_compare]), False)
       [2024/03/07 17:06:46.874] bson/json_util.py:507: in loads
       [2024/03/07 17:06:46.874]     return json.loads(s, *args, **kwargs)
       [2024/03/07 17:06:46.874] /opt/python/3.7/lib/python3.7/json/__init__.py:361: in loads
       [2024/03/07 17:06:46.874]     return cls(**kw).decode(s)
       [2024/03/07 17:06:46.874] /opt/python/3.7/lib/python3.7/json/decoder.py:337: in decode
       [2024/03/07 17:06:46.874]     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
       [2024/03/07 17:06:46.874] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
       [2024/03/07 17:06:46.874] self = <json.decoder.JSONDecoder object at 0x7f1709ec7410>
       [2024/03/07 17:06:46.874] s = '{"topologyVersion": {"processId": {"$oid": "65ea467a31df1203c3087a24"}, "counter": 6}, "hosts": ["localhost:27017", "...$clusterTime": {"clusterTime": {"$timestamp": {"t": 1709852410, "i": 8}}, "signature": {"hash": {"$binary": {"base6...'
       [2024/03/07 17:06:46.874] idx = 0
       [2024/03/07 17:06:46.874]     def raw_decode(self, s, idx=0):
       [2024/03/07 17:06:46.874]         """Decode a JSON document from ``s`` (a ``str`` beginning with
       [2024/03/07 17:06:46.874]         a JSON document) and return a 2-tuple of the Python
       [2024/03/07 17:06:46.874]         representation and the index in ``s`` where the document ended.
       [2024/03/07 17:06:46.874]     
       [2024/03/07 17:06:46.874]         This can be used to decode a JSON document from a string that may
       [2024/03/07 17:06:46.874]         have extraneous data at the end.
       [2024/03/07 17:06:46.874]     
       [2024/03/07 17:06:46.874]         """
       [2024/03/07 17:06:46.874]         try:
       [2024/03/07 17:06:46.874] >           obj, end = self.scan_once(s, idx)
       [2024/03/07 17:06:46.874] E           json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 995 (char 994)
       [2024/03/07 17:06:46.874] /opt/python/3.7/lib/python3.7/json/decoder.py:353: JSONDecodeError
      

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

              Created:
              Updated:
              Resolved: