e2e: simplify test cleanup
ginkgo.DeferCleanup has multiple advantages: - The cleanup operation can get registered if and only if needed. - No need to return a cleanup function that the caller must invoke. - Automatically determines whether a context is needed, which will simplify the introduction of context parameters. - Ginkgo's timeline shows when it executes the cleanup operation.
This commit is contained in:
@@ -910,7 +910,7 @@ func runTopologyManagerTests(f *framework.Framework) {
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
sd := setupSRIOVConfigOrFail(f, configMap)
|
||||
defer teardownSRIOVConfigOrFail(f, sd)
|
||||
ginkgo.DeferCleanup(teardownSRIOVConfigOrFail, f, sd)
|
||||
|
||||
scope := containerScopeTopology
|
||||
for _, policy := range policies {
|
||||
|
Reference in New Issue
Block a user