From 55eb53e3a0ce1ccfb9f444adeac695df4d6513c9 Mon Sep 17 00:00:00 2001 From: Rostyslav Polishchuk Date: Thu, 10 Apr 2025 00:18:22 +0000 Subject: [PATCH] fix: order dependent test TestInstallRelease_Atomic_Interrupted needs the same wait as TestInstallRelease_Wait_Interrupted (see helm/helm#12088). The installation goroutine started by TestInstallRelease_Atomic_Interrupted proceeds in the background and may interfere with other tests (see helm/helm#30610) Also see helm/helm#12086 and helm/helm#12109 which are describe and address the root cause. Signed-off-by: Rostyslav Polishchuk --- pkg/action/install_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/action/install_test.go b/pkg/action/install_test.go index aafda86c2..b2d147188 100644 --- a/pkg/action/install_test.go +++ b/pkg/action/install_test.go @@ -521,6 +521,8 @@ func TestInstallRelease_Atomic_Interrupted(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) time.AfterFunc(time.Second, cancel) + goroutines := runtime.NumGoroutine() + res, err := instAction.RunWithContext(ctx, buildChart(), vals) is.Error(err) is.Contains(err.Error(), "context canceled") @@ -531,6 +533,9 @@ func TestInstallRelease_Atomic_Interrupted(t *testing.T) { _, err = instAction.cfg.Releases.Get(res.Name, res.Version) is.Error(err) is.Equal(err, driver.ErrReleaseNotFound) + is.Equal(goroutines+1, runtime.NumGoroutine()) // installation goroutine still is in background + time.Sleep(10 * time.Second) // wait for goroutine to finish + is.Equal(goroutines, runtime.NumGoroutine()) } func TestNameTemplate(t *testing.T) {