From 1a94c6c9329c3a2cdc0f3e56fd5036f09789f117 Mon Sep 17 00:00:00 2001 From: Purna Pavan Chandra Date: Mon, 29 Apr 2024 11:52:19 +0000 Subject: [PATCH] tests: clean up snapshot dir after restore The snapshot_dir is not needed anymore fter the guest is restored. Hence, remove it. This will potentially avoid transient failures caused due to insufficient disk space. Signed-off-by: Purna Pavan Chandra --- tests/integration.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/integration.rs b/tests/integration.rs index 7c7d0a433..6553d8fe8 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2344,7 +2344,10 @@ fn make_guest_panic(guest: &Guest) { } mod common_parallel { - use std::{fs::OpenOptions, io::SeekFrom}; + use std::{ + fs::{remove_dir_all, OpenOptions}, + io::SeekFrom, + }; use crate::*; @@ -6229,6 +6232,9 @@ mod common_parallel { &event_path_restored )); + // Remove the snapshot dir + let _ = remove_dir_all(snapshot_dir.as_str()); + let r = std::panic::catch_unwind(|| { // Resume the VM assert!(remote_command(&api_socket_restored, "resume", None));