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 <rostyslavp@google.com>
pull/30737/head
Rostyslav Polishchuk 5 months ago
parent d8ca55fc66
commit 55eb53e3a0

@ -521,6 +521,8 @@ func TestInstallRelease_Atomic_Interrupted(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
time.AfterFunc(time.Second, cancel) time.AfterFunc(time.Second, cancel)
goroutines := runtime.NumGoroutine()
res, err := instAction.RunWithContext(ctx, buildChart(), vals) res, err := instAction.RunWithContext(ctx, buildChart(), vals)
is.Error(err) is.Error(err)
is.Contains(err.Error(), "context canceled") 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) _, err = instAction.cfg.Releases.Get(res.Name, res.Version)
is.Error(err) is.Error(err)
is.Equal(err, driver.ErrReleaseNotFound) 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) { func TestNameTemplate(t *testing.T) {

Loading…
Cancel
Save