From 014be8444ac19475906b633c2b8d74ae4922149c Mon Sep 17 00:00:00 2001 From: Kante Yin Date: Fri, 17 Feb 2023 16:47:04 +0800 Subject: [PATCH] Make sure resoruces will be cleaned up when initializing error Signed-off-by: Kante Yin --- test/integration/scheduler/plugins/plugins_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/scheduler/plugins/plugins_test.go b/test/integration/scheduler/plugins/plugins_test.go index 20c3bec480e..df7e4b5ae1c 100644 --- a/test/integration/scheduler/plugins/plugins_test.go +++ b/test/integration/scheduler/plugins/plugins_test.go @@ -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) } }