这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@anthonyshew
Copy link
Contributor

Description

We've been getting some strange CI flakes during compilation of the turbo CLI, so adding some debug logging to see if we can get more information on these.

Testing Instructions

CI

@anthonyshew anthonyshew requested a review from a team as a code owner November 7, 2025 04:30
@anthonyshew anthonyshew requested a review from tknickman November 7, 2025 04:30
@vercel
Copy link
Contributor

vercel bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
examples-basic-web Ready Ready Preview Comment Nov 7, 2025 1:04pm
examples-designsystem-docs Ready Ready Preview Comment Nov 7, 2025 1:04pm
examples-gatsby-web Ready Ready Preview Comment Nov 7, 2025 1:04pm
examples-kitchensink-blog Ready Ready Preview Comment Nov 7, 2025 1:04pm
examples-nonmonorepo Ready Ready Preview Comment Nov 7, 2025 1:04pm
examples-svelte-web Ready Ready Preview Comment Nov 7, 2025 1:04pm
examples-tailwind-web Ready Ready Preview Comment Nov 7, 2025 1:04pm
examples-vite-web Ready Ready Preview Comment Nov 7, 2025 1:04pm
turbo-site Ready Ready Preview Comment Nov 7, 2025 1:04pm

@anthonyshew anthonyshew changed the title ci: debugging for compilation issues ci: Debugging for compilation issues Nov 7, 2025
Comment on lines +203 to +222
- name: Capture state on timeout
if: cancelled()
run: |
echo "=========================================="
echo "INTEGRATION TEST STEP TIMED OUT"
echo "=========================================="
echo "Time: $(date)"
echo ""
echo "=== Active Rust/Cargo Processes (likely hung) ==="
ps aux | grep -E "[r]ustc|[c]argo" || echo "No rustc/cargo processes found"
echo ""
echo "=== Top CPU Consumers ==="
if [ "$RUNNER_OS" == "Linux" ]; then
ps aux --sort=-%cpu | head -15
elif [ "$RUNNER_OS" == "macOS" ]; then
ps aux -r | head -15
fi
echo ""
echo "(ICE files will be checked in next step)"
shell: bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Capture state on timeout" steps use if: cancelled() condition, but this won't trigger when a step times out—it only triggers when the entire workflow is cancelled by a user or external event. These steps should use if: always() or another appropriate condition to ensure they execute during step timeouts.

View Details
📝 Patch Details
diff --git a/.github/workflows/turborepo-test.yml b/.github/workflows/turborepo-test.yml
index a075c3196..3908f4d23 100644
--- a/.github/workflows/turborepo-test.yml
+++ b/.github/workflows/turborepo-test.yml
@@ -201,7 +201,7 @@ jobs:
         shell: bash
 
       - name: Capture state on timeout
-        if: cancelled()
+        if: always()
         run: |
           echo "=========================================="
           echo "INTEGRATION TEST STEP TIMED OUT"
@@ -449,7 +449,7 @@ jobs:
         shell: bash
 
       - name: Capture state on timeout
-        if: cancelled()
+        if: always()
         run: |
           echo "=========================================="
           echo "RUST TEST STEP TIMED OUT"

Analysis

GitHub Actions "Capture state on timeout" steps use wrong condition

What fails: The "Capture state on timeout" steps in both the integration and rust_test jobs (lines 203 and 451) use if: cancelled() condition, which does not trigger when a step times out.

How to reproduce: Set up a GitHub Actions workflow with a step that has timeout-minutes: 45 and a debug step with if: cancelled() immediately after it. Let the first step exceed its timeout limit.

Result: The debug step with if: cancelled() does NOT execute when the preceding step times out. The workflow continues without capturing the debug state information.

Expected: According to GitHub Actions documentation on expressions, the cancelled() function "Returns true if the workflow was canceled." This refers to workflow-level cancellation (user cancellation), not step timeouts. Step-level timeouts ("The maximum number of minutes to run the step before killing the process") result in step failure, not workflow cancellation. Therefore, if: cancelled() will not trigger on step timeouts. The condition should be if: always() to ensure debug steps execute regardless of preceding step status.

Fix: Change if: cancelled() to if: always() in both "Capture state on timeout" steps to ensure they execute during step timeouts and capture the intended diagnostic information.

@anthonyshew anthonyshew merged commit 7e12598 into main Nov 7, 2025
38 checks passed
@anthonyshew anthonyshew deleted the shew/727f5 branch November 7, 2025 13:29
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.

2 participants