[Lldb-commits] [lldb] 3367dfd - [lldb] Print the output of failed attempts of flaky tests (#229483)

via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 6 10:46:23 PDT 2026


Author: Charles Zablit
Date: 2026-10-06T18:46:16+01:00
New Revision: 3367dfdaea69215130b00118e176d6dcac042ad0

URL: https://github.com/llvm/llvm-project/commit/3367dfdaea69215130b00118e176d6dcac042ad0
DIFF: https://github.com/llvm/llvm-project/commit/3367dfdaea69215130b00118e176d6dcac042ad0.diff

LOG: [lldb] Print the output of failed attempts of flaky tests (#229483)

This patch adds a mechanism to log the output of the failed tries of a
flaky test which ended up passing after multiple attempts.

Added: 
    

Modified: 
    lldb/test/lldbflakes.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/lldbflakes.py b/lldb/test/lldbflakes.py
index 4f2b80aeda042..785264fb92547 100644
--- a/lldb/test/lldbflakes.py
+++ b/lldb/test/lldbflakes.py
@@ -24,8 +24,13 @@ def _hit_known_flake(output):
 def execute_with_reruns(execute_once):
     """Run execute_once, which returns a lit.Test.Result, until it stops
     failing with a known flake."""
+    outputs = []
     for attempt in range(MAX_ATTEMPTS):
         result = execute_once()
+        outputs.append(
+            "Attempt %d of %d: %s\n%s"
+            % (attempt + 1, MAX_ATTEMPTS, result.code.name, result.output)
+        )
         if result.code != lit.Test.FAIL or not _hit_known_flake(result.output):
             break
 
@@ -36,5 +41,6 @@ def execute_with_reruns(execute_once):
             result.code = lit.Test.FLAKYPASS
         result.attempts = attempt + 1
         result.max_allowed_attempts = MAX_ATTEMPTS
+        result.output = "\n".join(outputs)
 
     return result


        


More information about the lldb-commits mailing list