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.
This commit is contained in:
Kubernetes Submit Queue 2017-04-05 17:43:24 -07:00 committed by GitHub
commit 774264968d
2 changed files with 4 additions and 3 deletions

View File

@ -209,8 +209,8 @@ func (cma *chaosMonkeyAdapter) Test(sem *chaosmonkey.Semaphore) {
return
}
cma.test.Setup(cma.framework)
defer cma.test.Teardown(cma.framework)
cma.test.Setup(cma.framework)
sem.Ready()
cma.test.Test(cma.framework, sem.StopCh, cma.upgradeType)
}

View File

@ -56,8 +56,9 @@ type Test interface {
// begin.
Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)
// TearDown should clean up any objects that are created that
// aren't already cleaned up by the framework.
// Teardown should clean up any objects that are created that
// aren't already cleaned up by the framework. This will
// always be called, even if Setup failed.
Teardown(f *framework.Framework)
}