Skip to content

Fix CI script bugs in wait-for-test-completion and cache-test-artifacts#12330

Open
fasaxc wants to merge 1 commit intoprojectcalico:masterfrom
fasaxc:fix-ci-script-bugs
Open

Fix CI script bugs in wait-for-test-completion and cache-test-artifacts#12330
fasaxc wants to merge 1 commit intoprojectcalico:masterfrom
fasaxc:fix-ci-script-bugs

Conversation

@fasaxc
Copy link
Copy Markdown
Member

@fasaxc fasaxc commented Apr 2, 2026

Fix three bugs in CI scripts found by Copilot review of #12195:

  • wait-for-test-completion: If test.pid is missing or unreadable, cat test.pid returns empty, so the check [ -e "/proc/" ] is always true, causing an infinite CI hang. Now validates that test.pid exists and contains a numeric PID, exiting with code 66 (the "something went wrong" code) otherwise.

  • felix/.semaphore/cache-test-artifacts: tar --exclude patterns like --exclude=.go-pkg-cache don't match when the archive root is ${CALICO_DIR_NAME}/... (after cd ../..). Prefix excludes with ${CALICO_DIR_NAME}/ so they actually take effect, reducing the working-copy tarball size.

  • node/.semaphore/cache-test-artifacts: Same tar exclude fix.

- wait-for-test-completion: Validate test.pid exists and contains a
  numeric PID before checking /proc. Previously, a missing or empty
  test.pid would cause `[ -e "/proc/" ]` to always be true, hanging
  the CI job forever.

- felix/.semaphore/cache-test-artifacts: Prefix tar --exclude patterns
  with ${CALICO_DIR_NAME}/ so they actually match the archived paths.
  Without the prefix, excludes like .go-pkg-cache and artifacts had
  no effect, making the working-copy tarball unnecessarily large.

- node/.semaphore/cache-test-artifacts: Same tar --exclude fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 2, 2026 10:42
@fasaxc fasaxc requested a review from a team as a code owner April 2, 2026 10:42
@marvin-tigera marvin-tigera added this to the Calico v3.33.0 milestone Apr 2, 2026
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 2, 2026
@fasaxc fasaxc added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact and removed release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes correctness issues in Semaphore CI helper scripts used to run tests on VMs and cache/upload working-copy artifacts to GCS, preventing hangs and ensuring tar exclusions actually apply when the archive root is the checkout directory.

Changes:

  • Make felix/.semaphore/wait-for-test-completion validate test.pid existence and numeric content to avoid an infinite wait when the PID file is missing/invalid.
  • Update felix/.semaphore/cache-test-artifacts tar --exclude paths to be rooted at ${CALICO_DIR_NAME}/... so excludes match after cd ../...
  • Apply the same tar exclude rooting fix to node/.semaphore/cache-test-artifacts.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
felix/.semaphore/wait-for-test-completion Prevents CI hangs by treating missing/invalid test.pid as an error and returning 66.
felix/.semaphore/cache-test-artifacts Fixes tar exclusion patterns so unwanted dirs don’t get included in the uploaded working copy.
node/.semaphore/cache-test-artifacts Same tar exclusion fix for node FV artifact caching.

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

Labels

docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants