Skip to content

fix: Use unique namespaces per e2e test to prevent resource conflicts#58

Merged
pradithya merged 2 commits intomainfrom
fix/ci-stability
Feb 21, 2026
Merged

fix: Use unique namespaces per e2e test to prevent resource conflicts#58
pradithya merged 2 commits intomainfrom
fix/ci-stability

Conversation

@pradithya
Copy link
Owner

@pradithya pradithya commented Feb 21, 2026

Summary

  • Parallel e2e tests were sharing the e2e-test-apps namespace for deploying guestbook resources, causing ArgoCD resource tracking conflicts
  • When multiple Applications manage the same Deployment/Service, resource ownership ping-pongs between apps, leaving some with healthStatus=Missing and causing flaky timeouts (e.g. TestE2ESyncAutoMergeDisabledLocksRetained)
  • Each test application now deploys to its own namespace (derived from the app name) with CreateNamespace=true, ensuring complete isolation between parallel tests

Test plan

  • CI e2e tests pass consistently
  • Re-run CI 3 times to confirm stability

🤖 Generated with Claude Code

Parallel e2e tests were deploying the same guestbook resources to a shared
namespace (e2e-test-apps), causing ArgoCD resource tracking conflicts. When
multiple Applications manage the same resources, ownership ping-pongs between
apps, leaving some with healthStatus=Missing and causing flaky timeouts.

Each test application now deploys to its own namespace (derived from the app
name) with CreateNamespace=true, ensuring complete isolation between parallel
tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 21, 2026 08:46
@codecov-commenter
Copy link

codecov-commenter commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@2454d72). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #58   +/-   ##
=======================================
  Coverage        ?   32.98%           
=======================================
  Files           ?       55           
  Lines           ?     7143           
  Branches        ?        0           
=======================================
  Hits            ?     2356           
  Misses          ?     4679           
  Partials        ?      108           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

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

Updates the e2e suite to avoid Argo CD resource ownership conflicts in parallel runs by moving test Applications off the shared e2e-test-apps namespace and into per-test namespaces, and enabling namespace auto-creation during sync.

Changes:

  • Switch e2e tests to call createTestApplication* with an empty namespace so helpers derive a unique namespace from the app name.
  • Update e2e helper constructors to default Destination.Namespace to name and set SyncPolicy.SyncOptions=CreateNamespace=true.
  • Apply the same namespace strategy to the ApplicationSet helper/template.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
e2e/helpers_test.go Changes helper defaults to per-app namespaces and adds CreateNamespace sync option; updates ApplicationSet destination namespace.
e2e/sync_workflow_test.go Updates app creation calls to use per-test namespaces via helpers.
e2e/unlock_workflow_test.go Updates app creation callsites to use per-test namespaces via helpers.
e2e/rollback_workflow_test.go Updates app creation callsites to use per-test namespaces via helpers.
e2e/plan_workflow_test.go Updates app creation callsites to use per-test namespaces via helpers.
e2e/argocd_client_test.go Updates the “real app” helper call to use a per-test namespace.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…amespaces

Address review feedback:
- ApplicationSet template now uses per-generated-app namespace (name-{{ .env }})
  to prevent resource conflicts between generated apps
- All mocked YAML config strings in tests updated to use per-test namespace
  instead of hardcoded e2e-test-apps, preventing spec overrides during sync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pradithya pradithya merged commit 148cd69 into main Feb 21, 2026
28 checks passed
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.

3 participants