Skip to content

chore(ci): Fix flaky cca tests#1811

Merged
Tobbe merged 2 commits into
mainfrom
tobbe-chore-ci-fix-flaky-cca-tests
May 22, 2026
Merged

chore(ci): Fix flaky cca tests#1811
Tobbe merged 2 commits into
mainfrom
tobbe-chore-ci-fix-flaky-cca-tests

Conversation

@Tobbe
Copy link
Copy Markdown
Member

@Tobbe Tobbe commented May 22, 2026

CI was failing on the CCA tests in #1799
This is my attempted fix

@netlify
Copy link
Copy Markdown

netlify Bot commented May 22, 2026

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 11b182b
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6a0fc2b5fe20fa000845aad4

@github-actions github-actions Bot added this to the chore milestone May 22, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

Greptile Summary

This PR addresses flaky CCA (create-cedar-app) E2E tests by making post-test directory cleanup more resilient: it adds a brief delay and swallows errors when git may still be writing to .git/objects after the generator exits.

  • e2e.test.ts: Replaces the single fs.rm call with a removeGeneratedApp helper that retries up to 3 times with 500 ms back-off, warns on final failure, and also tightens the unknown-options error handler with an explicit type guard instead of the loosely typed catch (p).
  • Six Tcl/Expect shell scripts: Consolidates cleanup into a single unconditional after 500; catch {exec rm -rf $projectDirectory} block before the exit-status check, making cleanup best-effort and independent of the test outcome in all scripts.

Confidence Score: 5/5

All changes are confined to test cleanup code; no production logic is touched and the fix correctly addresses the identified race condition.

The changes are narrow and well-understood: a retry wrapper around directory removal in the TypeScript test, and equivalent best-effort cleanup in the shell scripts. No application logic is modified, and the Tcl catch/after usage is correct.

No files require special attention.

Important Files Changed

Filename Overview
packages/create-cedar-app/tests/e2e.test.ts Adds retry logic for post-test cleanup and tightens type safety in the unknown-options error handler — clean, targeted fix.
packages/create-cedar-app/tests/e2e_prompts.sh Moves cleanup before the exit-status branch, adds 500 ms delay and wraps rm -rf in catch to make cleanup best-effort; correct Tcl/Expect usage.
packages/create-cedar-app/tests/e2e_prompts_git.sh Same best-effort cleanup pattern as e2e_prompts.sh — consistent across all prompt scripts.
packages/create-cedar-app/tests/e2e_prompts_m.sh Same best-effort cleanup pattern applied uniformly.
packages/create-cedar-app/tests/e2e_prompts_node_greater.sh Same best-effort cleanup pattern applied uniformly.
packages/create-cedar-app/tests/e2e_prompts_overwrite.sh Same best-effort cleanup pattern; note this script expects exitStatus 1 for success, which is preserved correctly.
packages/create-cedar-app/tests/e2e_prompts_ts.sh Same best-effort cleanup pattern applied uniformly.

Reviews (2): Last reviewed commit: "more cca flakyness fixes" | Re-trigger Greptile

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 22, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 11b182b

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 2s View ↗
nx run-many -t build ✅ Succeeded 3m 12s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-22 03:26:23 UTC

lisa-assistant added a commit to lisa-assistant/cedar that referenced this pull request May 22, 2026
… install

The yarn install for packages/create-cedar-rsc-app has been intermittently
failing on Windows CI with exit code 127 ("command not found"). Documents
the 2026-05-22 failure from PR cedarjs#1811 run 26263998951.
@Tobbe Tobbe merged commit d505d4f into main May 22, 2026
70 of 75 checks passed
@Tobbe Tobbe deleted the tobbe-chore-ci-fix-flaky-cca-tests branch May 22, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant