Make sure resoruces will be cleaned up when initializing error

Signed-off-by: Kante Yin <kerthcet@gmail.com>
This commit is contained in:
Kante Yin 2023-02-17 16:47:04 +08:00
parent 5d9d06aa47
commit 014be8444a

View File

@ -2556,6 +2556,8 @@ func initTestSchedulerForFrameworkTest(t *testing.T, testCtx *testutils.TestCont
if nodeCount > 0 {
if _, err := createAndWaitForNodesInCache(testCtx, "test-node", st.MakeNode(), nodeCount); err != nil {
// Make sure to cleanup the resources when initializing error.
testutils.CleanupTest(t, testCtx)
t.Fatal(err)
}
}