fix(e2e): retry Helm chart uninstall on transient cascade=foreground race - #323
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
helm delete --wait --cascade=foregroundcan 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.zookeeper-operator's uninstall failed withresource 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.Eventually-based retry for the post-uninstall "resources removed" check (requireHelmManagedResourcesRemoved), but not for theuninstallHelmChart()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 sharedrequireHelmChartUninstalledhelper.uninstallHelmChartfirst 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-runninghelm delete.Test plan
go build ./...andgo vet ./...pass fortests/e2egofmt -lclean🤖 Generated with Claude Code