Skip to content

Commit 72bb07f

Browse files
committed
test: Fix flakiness in multi-target image test
1 parent 6eb63d5 commit 72bb07f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tests/helpers.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ impl Drop for CowImage {
159159
}
160160

161161
// Create a CoW image to ensure each test runs in a clean image.
162+
//
163+
// We've seen some really odd flakiness issues when the same image
164+
// is reused. It may be a nixos thing. Still unclear.
162165
pub fn create_new_image(image: PathBuf) -> CowImage {
163166
let out_image = gen_image_name();
164167
let out = Command::new("qemu-img")

tests/test.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,14 @@ fn test_kernel_ro_flag() {
278278

279279
#[test]
280280
fn test_run_custom_resources() {
281-
let uefi_image = create_new_image(asset("image-uefi.raw-efi"));
281+
let uefi_image_t1 = create_new_image(asset("image-uefi.raw-efi"));
282+
let uefi_image_t2 = create_new_image(asset("image-uefi.raw-efi"));
282283

283284
let config = Config {
284285
target: vec![
285286
Target {
286287
name: "Custom number of CPUs".to_string(),
287-
image: Some(uefi_image.as_pathbuf()),
288+
image: Some(uefi_image_t1.as_pathbuf()),
288289
uefi: true,
289290
command: r#"bash -xc "[[ "$(nproc)" == "1" ]]""#.into(),
290291
kernel: None,
@@ -296,7 +297,7 @@ fn test_run_custom_resources() {
296297
},
297298
Target {
298299
name: "Custom amount of RAM".to_string(),
299-
image: Some(uefi_image.as_pathbuf()),
300+
image: Some(uefi_image_t2.as_pathbuf()),
300301
uefi: true,
301302
// Should be in the 200 thousands, but it's variable.
302303
command: r#"bash -xc "cat /proc/meminfo | grep 'MemTotal: 2..... kB'""#

0 commit comments

Comments
 (0)