What happened?
During informer sync, resources briefly report as Unknown. Causing the observer to cancel the watch early, causing intermittent test flakes.
statusObserver skips Unknown resources when desired == NotFoundStatus, so if all resources happen to be in that transient state the filtered list (rss) is empty. aggregator.AggregateStatus on an empty slice returns the desired status, causing cancel() to fire immediately — before any real status event is delivered. The watch exits without hitting the deadline, so ctx.Err() returns nil, and the test assertion for "context deadline exceeded" fails.
PR attempted to fix, but #32081 caused #32214 (#32081 was then reverted)
What did you expect to happen?
WaitForDelete needs to handle transient informer initialization behavior, and not assume Unknown resources can be skipped.
The fix must include some sort of testing to show that object which are expected to be deleted e.g. hook objects which utilize helm.sh/hook-delete-policy: before-hook-creation are successfully "waited" (ie. skipped).
How can we reproduce it (as minimally and precisely as possible)?
Repeated runs of TestStatusWaitForDelete
Helm version
Details
$ helm version
version.BuildInfo{Version:"v4.2.2", GitCommit:"b05881cf967a5a09e19866799d0edfd40675803a", GitTreeState:"clean", GoVersion:"go1.26.4", KubeClientVersion:"v1.36"}
Kubernetes version
N/A
What happened?
During informer sync, resources briefly report as
Unknown. Causing the observer to cancel the watch early, causing intermittent test flakes.statusObserverskipsUnknownresources whendesired == NotFoundStatus, so if all resources happen to be in that transient state the filtered list (rss) is empty.aggregator.AggregateStatuson an empty slice returns the desired status, causing cancel() to fire immediately — before any real status event is delivered. The watch exits without hitting the deadline, soctx.Err()returns nil, and the test assertion for "context deadline exceeded" fails.PR attempted to fix, but #32081 caused #32214 (#32081 was then reverted)
What did you expect to happen?
WaitForDeleteneeds to handle transient informer initialization behavior, and not assumeUnknownresources can be skipped.The fix must include some sort of testing to show that object which are expected to be deleted e.g. hook objects which utilize
helm.sh/hook-delete-policy: before-hook-creationare successfully "waited" (ie. skipped).How can we reproduce it (as minimally and precisely as possible)?
Repeated runs of
TestStatusWaitForDeleteHelm version
Details
Kubernetes version
N/A