This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new db15fff4b9b Count cancelled runs in last-5 flaky check (#38614)
db15fff4b9b is described below

commit db15fff4b9b4563ef376b74e0f984f60d757a65e
Author: Abdelrahman Ibrahim <[email protected]>
AuthorDate: Sat May 23 14:27:11 2026 +0200

    Count cancelled runs in last-5 flaky check (#38614)
---
 .../metrics/sync/github/github_runs_prefetcher/code/main.py    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/.test-infra/metrics/sync/github/github_runs_prefetcher/code/main.py 
b/.test-infra/metrics/sync/github/github_runs_prefetcher/code/main.py
index 76d8e488bce..2b91c862a7f 100644
--- a/.test-infra/metrics/sync/github/github_runs_prefetcher/code/main.py
+++ b/.test-infra/metrics/sync/github/github_runs_prefetcher/code/main.py
@@ -188,10 +188,14 @@ async def check_workflow_flakiness(workflow):
 
     print(f"Success rate: {success_rate}")
 
-    # Check if last 5 runs are all failures
-    last_5_failed = len(workflow_runs) >= 5 and all(run.status == "failure" 
for run in workflow_runs[:5])
+    # Check if last 5 runs are all failures or cancelled (e.g. job timeout)
+    last_5_failed = len(workflow_runs) >= 5 and all(
+        run.status in ("failure", "cancelled") for run in workflow_runs[:5]
+    )
     if last_5_failed:
-        print(f"The last 5 workflow runs for {workflow.name} have all failed")
+        print(
+            f"The last 5 workflow runs for {workflow.name} have all failed or 
been cancelled"
+        )
 
     return success_rate < workflow.threshold or last_5_failed
 

Reply via email to