From 6b4bde5f870b34c34a6471a017a25a3fe46a8ce3 Mon Sep 17 00:00:00 2001 From: Anand Kumar Singh Date: Tue, 28 Sep 2021 03:23:20 +0530 Subject: [PATCH] resolve windows os.remove error (#5091) Signed-off-by: anandrkskd --- tests/integration/devfile/cmd_devfile_create_test.go | 1 + tests/integration/devfile/cmd_devfile_debug_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/devfile/cmd_devfile_create_test.go b/tests/integration/devfile/cmd_devfile_create_test.go index 355ce37d4d6..3df770f1a44 100644 --- a/tests/integration/devfile/cmd_devfile_create_test.go +++ b/tests/integration/devfile/cmd_devfile_create_test.go @@ -168,6 +168,7 @@ var _ = Describe("odo devfile create command tests", func() { values := gjson.GetMany(output, "kind", "metadata.name", "status.state") Expect(helper.GjsonMatcher(values, []string{"Component", "nodejs", "Unknown"})).To(Equal(true)) + newKubeConfig.Close() err = os.Remove(newKubeConfigPath) Expect(err).To(BeNil()) }) diff --git a/tests/integration/devfile/cmd_devfile_debug_test.go b/tests/integration/devfile/cmd_devfile_debug_test.go index f25b011b08a..83b78b06e81 100644 --- a/tests/integration/devfile/cmd_devfile_debug_test.go +++ b/tests/integration/devfile/cmd_devfile_debug_test.go @@ -110,7 +110,7 @@ var _ = Describe("odo devfile debug command tests", func() { runningString := helper.Cmd("odo", "debug", "info", "--context", commonVar.Context).ShouldPass().Out() Expect(runningString).To(ContainSubstring(freePort)) Expect(helper.ListFilesInDir(os.TempDir())).To(ContainElement(commonVar.Project + "-nodejs-cmp-odo-debug.json")) - helper.DeleteFile(filepath.Join(os.TempDir(), commonVar.Project+"-nodejs-cmp-odo-debug.json")) + defer helper.DeleteFile(filepath.Join(os.TempDir(), commonVar.Project+"-nodejs-cmp-odo-debug.json")) stopChannel <- true })