helm/helm

fix: `TestStatusWaitForDelete` flakes due to `WaitForDelete` informer initialization race

Open

#32,261 opened on 2026年6月23日

GitHub で見る
 (3 comments) (1 reaction) (0 assignees)Go (7,602 forks)batch import
help wanted

Repository metrics

Stars
 (29,815 stars)
PR merge metrics
 (平均マージ 40d 17h) (30d で 48 merged PRs)

説明

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 https://github.com/helm/helm/pull/32081 caused https://github.com/helm/helm/issues/32214 (https://github.com/helm/helm/pull/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

$ helm version
version.BuildInfo{Version:"v4.2.2", GitCommit:"b05881cf967a5a09e19866799d0edfd40675803a", GitTreeState:"clean", GoVersion:"go1.26.4", KubeClientVersion:"v1.36"}

Kubernetes version

N/A

コントリビューターガイド