mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
e2e: move deleteState file to the AfterEach
Under the CPU manager and topology manager e2e tests possible the situation when one of steps under the test will fail and it will not clean the CPU manager state file. Move the deletion of the state file to `AfterEach` to guarantee that the state file will be always removed from the node. Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
This commit is contained in:
parent
2a4c956b0c
commit
97ac255513
@ -627,7 +627,9 @@ func runCPUManagerTests(f *framework.Framework) {
|
||||
ginkgo.By("wait for the deleted pod to be cleaned up from the state file")
|
||||
waitForStateFileCleanedUp()
|
||||
ginkgo.By("the deleted pod has already been deleted from the state file")
|
||||
})
|
||||
|
||||
ginkgo.AfterEach(func() {
|
||||
setOldKubeletConfig(f, oldCfg)
|
||||
})
|
||||
}
|
||||
|
@ -880,11 +880,6 @@ func runTopologyManagerTests(f *framework.Framework) {
|
||||
// Run the tests
|
||||
runTopologyManagerPolicySuiteTests(f)
|
||||
}
|
||||
// restore kubelet config
|
||||
setOldKubeletConfig(f, oldCfg)
|
||||
|
||||
// Delete state file to allow repeated runs
|
||||
deleteStateFile()
|
||||
})
|
||||
|
||||
ginkgo.It("run Topology Manager node alignment test suite", func() {
|
||||
@ -922,12 +917,6 @@ func runTopologyManagerTests(f *framework.Framework) {
|
||||
|
||||
runTopologyManagerNodeAlignmentSuiteTests(f, sd, reservedSystemCPUs, policy, numaNodes, coreCount)
|
||||
}
|
||||
|
||||
// restore kubelet config
|
||||
setOldKubeletConfig(f, oldCfg)
|
||||
|
||||
// Delete state file to allow repeated runs
|
||||
deleteStateFile()
|
||||
})
|
||||
|
||||
ginkgo.It("run the Topology Manager pod scope alignment test suite", func() {
|
||||
@ -956,9 +945,11 @@ func runTopologyManagerTests(f *framework.Framework) {
|
||||
reservedSystemCPUs := configureTopologyManagerInKubelet(f, oldCfg, policy, scope, configMap, numaNodes)
|
||||
|
||||
runTMScopeResourceAlignmentTestSuite(f, configMap, reservedSystemCPUs, policy, numaNodes, coreCount)
|
||||
})
|
||||
|
||||
ginkgo.AfterEach(func() {
|
||||
// restore kubelet config
|
||||
setOldKubeletConfig(f, oldCfg)
|
||||
deleteStateFile()
|
||||
})
|
||||
}
|
||||
|
||||
@ -969,5 +960,4 @@ var _ = SIGDescribe("Topology Manager [Serial] [Feature:TopologyManager][NodeFea
|
||||
ginkgo.Context("With kubeconfig updated to static CPU Manager policy run the Topology Manager tests", func() {
|
||||
runTopologyManagerTests(f)
|
||||
})
|
||||
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user