Skip to content

[lldb][test] Fix duplicate error messages in expect_expr/var_path#202310

Open
Teemperor wants to merge 1 commit into
llvm:mainfrom
Teemperor:LLDB-FixDuplicateErrorInExpect
Open

[lldb][test] Fix duplicate error messages in expect_expr/var_path#202310
Teemperor wants to merge 1 commit into
llvm:mainfrom
Teemperor:LLDB-FixDuplicateErrorInExpect

Conversation

@Teemperor
Copy link
Copy Markdown
Contributor

The error message field for expect_* methods always prints the value object, so there is no need to specify a custom error message that then just prints the object too.

This fixes the duplicate value object printout on test failures.

@llvmorg-github-actions
Copy link
Copy Markdown

@llvm/pr-subscribers-lldb

Author: Raphael Isemann (Teemperor)

Changes

The error message field for expect_* methods always prints the value object, so there is no need to specify a custom error message that then just prints the object too.

This fixes the duplicate value object printout on test failures.


Full diff: https://github.com/llvm/llvm-project/pull/202310.diff

1 Files Affected:

  • (modified) lldb/packages/Python/lldbsuite/test/lldbtest.py (+2-2)
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 76b6fe7d7f637..f7d0d317f0535 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2923,7 +2923,7 @@ def expect_expr(
             summary=result_summary,
             children=result_children,
         )
-        value_check.check_value(self, eval_result, str(eval_result))
+        value_check.check_value(self, eval_result)
         return eval_result
 
     def expect_var_path(
@@ -2950,7 +2950,7 @@ def expect_var_path(
         value_check = ValueCheck(
             type=type, value=value, summary=summary, children=children
         )
-        value_check.check_value(self, eval_result, str(eval_result))
+        value_check.check_value(self, eval_result)
         return eval_result
 
     """Assert that an lldb.SBError is in the "success" state."""

@Teemperor
Copy link
Copy Markdown
Contributor Author

For reviewing, the value check function starts with this, so this custom error_msg is redundant.

    def check_value(self, test_base, val, error_msg=None):
        """
        [...]
        """

        this_error_msg = error_msg if error_msg else ""
        this_error_msg += "\nChecking SBValue: " + str(val)

@charles-zablit
Copy link
Copy Markdown
Contributor

sccache failed to start in the Windows job. rerunning.

@charles-zablit
Copy link
Copy Markdown
Contributor

Hey @boomanaiden154, there seems to be an issue with sccache not being able to connect on the Windows runners. I'm not sure who to ping regarding this.

The error message field for expect_* methods always prints the
value object, so there is no need to specify a custom error message
that then just prints the object too.

This fixes the duplicate value object printout on test failures.
@Teemperor Teemperor force-pushed the LLDB-FixDuplicateErrorInExpect branch from 10c815c to 7e425be Compare June 8, 2026 12:50
@boomanaiden154
Copy link
Copy Markdown
Contributor

The general practice is to file
an issue with the infrastructure label. There's already one I created last night.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants