Commit 77426496 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #44104 from krousey/upgrades

Automatic merge from submit-queue (batch tested with PRs 44104, 43903, 44109) Make sure Teardown is called. This will ensure that tests get a chance to clean up resources even if setup failed part way through.
parents 2d023d96 90f8d622
...@@ -209,8 +209,8 @@ func (cma *chaosMonkeyAdapter) Test(sem *chaosmonkey.Semaphore) { ...@@ -209,8 +209,8 @@ func (cma *chaosMonkeyAdapter) Test(sem *chaosmonkey.Semaphore) {
return return
} }
cma.test.Setup(cma.framework)
defer cma.test.Teardown(cma.framework) defer cma.test.Teardown(cma.framework)
cma.test.Setup(cma.framework)
sem.Ready() sem.Ready()
cma.test.Test(cma.framework, sem.StopCh, cma.upgradeType) cma.test.Test(cma.framework, sem.StopCh, cma.upgradeType)
} }
......
...@@ -56,8 +56,9 @@ type Test interface { ...@@ -56,8 +56,9 @@ type Test interface {
// begin. // begin.
Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType) Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
// TearDown should clean up any objects that are created that // Teardown should clean up any objects that are created that
// aren't already cleaned up by the framework. // aren't already cleaned up by the framework. This will
// always be called, even if Setup failed.
Teardown(f *framework.Framework) Teardown(f *framework.Framework)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment