Skip to content

Commit 256df34

Browse files
Update cli/tests/cli/create/option_one_file_system.rs
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 8c30eac commit 256df34

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/tests/cli/create/option_one_file_system.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ mod platform {
4646
let _ = fs::remove_dir_all("option_one_file_system_mount");
4747
fs::create_dir_all("option_one_file_system_mount/in/subdir").unwrap();
4848

49+
// Defer cleanup to ensure it runs even if the test panics.
50+
scopeguard::defer! {
51+
let _ = Command::new("umount").arg("option_one_file_system_mount/in/subdir").status();
52+
let _ = fs::remove_dir_all("option_one_file_system_mount");
53+
};
54+
4955
fs::write("option_one_file_system_mount/in/main_file.txt", "main fs").unwrap();
5056

5157
let mount_status = Command::new("mount")

0 commit comments

Comments
 (0)