From c2363b18dc9531d81898dbbce131d13205e40017 Mon Sep 17 00:00:00 2001 From: Subhransu <47723536+Shubhranshu153@users.noreply.github.com> Date: Mon, 11 Mar 2024 11:28:01 -0700 Subject: [PATCH] fix: Reset disks and force remove vm after suite execution (#846) Issue #, if available: *Description of changes: Force remove vm and clean disks. This gives a chance to recover from builkit failures caused by non-existent uuid files *Testing done:* - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Shubharanshu Mahapatra --- e2e/vm/vm_darwin_test.go | 1 + e2e/vm/vm_windows_test.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e/vm/vm_darwin_test.go b/e2e/vm/vm_darwin_test.go index f756a30cf..3d7206ad8 100644 --- a/e2e/vm/vm_darwin_test.go +++ b/e2e/vm/vm_darwin_test.go @@ -48,6 +48,7 @@ func TestVM(t *testing.T) { time.Sleep(1 * time.Second) command.New(o, "vm", "remove", "-f").WithoutCheckingExitCode().WithTimeoutInSeconds(20).Run() time.Sleep(1 * time.Second) + resetDisks(o, *e2e.Installed) }, func() {}) ginkgo.AfterEach(func() { diff --git a/e2e/vm/vm_windows_test.go b/e2e/vm/vm_windows_test.go index 5831388c5..2098483d5 100644 --- a/e2e/vm/vm_windows_test.go +++ b/e2e/vm/vm_windows_test.go @@ -36,8 +36,9 @@ func TestVM(t *testing.T) { }, func(_ []byte) {}) ginkgo.SynchronizedAfterSuite(func() { - command.New(o, "vm", "stop").WithTimeoutInSeconds(90).Run() - command.New(o, "vm", "remove").WithTimeoutInSeconds(60).Run() + command.New(o, "vm", "stop", "-f").WithTimeoutInSeconds(90).Run() + command.New(o, "vm", "remove", "-f").WithTimeoutInSeconds(60).Run() + resetDisks(o, *e2e.Installed) }, func() {}) ginkgo.Describe("", func() {