Skip to content

fix(e2e): retry Helm chart uninstall on transient cascade=foreground race - #323

Merged
amuraru merged 1 commit into
masterfrom
fix-e2e-helm-uninstall-retry
Aug 25, 2026
Merged

fix(e2e): retry Helm chart uninstall on transient cascade=foreground race#323
amuraru merged 1 commit into
masterfrom
fix-e2e-helm-uninstall-retry

Conversation

@amuraru

@amuraru amuraru commented Aug 25, 2026

Copy link
Copy Markdown

Summary

  • helm delete --wait --cascade=foreground can report a resource as still existing (status: Terminating) even though the release itself was already removed from Helm's storage, if Kubernetes' foreground GC hasn't finished reaping owned objects (Pods/ReplicaSets) yet.
  • This raced PR chore(deps): update Go dependencies #313's e2e run: zookeeper-operator's uninstall failed with resource Deployment/zookeeper/zookeeper-operator still exists ~240ms after the delete call — far too fast to be a real timeout, confirming it's Helm's immediate post-delete check racing the GC, not a stuck resource.
  • fix(e2e): wait for helm uninstall cleanup #320 already added Eventually-based retry for the post-uninstall "resources removed" check (requireHelmManagedResourcesRemoved), but not for the uninstallHelmChart() call itself. This PR closes that gap for all 5 Helm charts torn down in e2e (Koperator, zookeeper-operator, prometheus-operator, cert-manager, Contour) via a shared requireHelmChartUninstalled helper.
  • Retrying is safe: on retry, uninstallHelmChart first checks whether the release is still installed; since Helm already removed it from its storage on the first (failing) attempt, the retry short-circuits with a nil error instead of re-running helm delete.

Test plan

  • go build ./... and go vet ./... pass for tests/e2e
  • gofmt -l clean
  • e2e workflow passes on this PR (CI)

🤖 Generated with Claude Code

…race

helm delete --wait --cascade=foreground can report a resource as still
existing (status: Terminating) even though the release itself has
already been removed from Helm's storage, if Kubernetes' foreground GC
hasn't finished reaping owned objects (Pods/ReplicaSets) yet. This
raced PR #313's e2e run: zookeeper-operator's uninstall failed with
"resource Deployment/zookeeper/zookeeper-operator still exists" ~240ms
after the delete call, well before any real timeout.

#320 already added retry-on-Eventually for the post-uninstall
"resources removed" check, but not for the uninstallHelmChart() call
itself. Wrap all 5 Helm chart uninstalls (Koperator, zookeeper-operator,
prometheus-operator, cert-manager, Contour) in the same retry pattern
via a shared requireHelmChartUninstalled helper.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@amuraru
amuraru merged commit fb6d1c1 into master Aug 25, 2026
7 checks passed
@amuraru
amuraru deleted the fix-e2e-helm-uninstall-retry branch August 25, 2026 12:42
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