From 4e30bc7921b913b66cd22fa7f0f0371d6519907b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 1 Oct 2024 09:18:11 +0200 Subject: [PATCH] zfs-with-vdevs: increase pool import timeout Fix fixes a long-standing test failures we have with the zfs-with-vdevs. --- example/zfs-with-vdevs.nix | 2 -- tests/zfs-with-vdevs.nix | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/example/zfs-with-vdevs.nix b/example/zfs-with-vdevs.nix index 96750fd8..a61680a6 100644 --- a/example/zfs-with-vdevs.nix +++ b/example/zfs-with-vdevs.nix @@ -93,8 +93,6 @@ cache = [ "cache" ]; }; }; - # Workaround: cannot import 'zroot': I/O error in disko tests - options.cachefile = "none"; rootFsOptions = { compression = "zstd"; diff --git a/tests/zfs-with-vdevs.nix b/tests/zfs-with-vdevs.nix index dbca4fc9..da301a01 100644 --- a/tests/zfs-with-vdevs.nix +++ b/tests/zfs-with-vdevs.nix @@ -8,6 +8,15 @@ diskoLib.testLib.makeDiskoTest { extraInstallerConfig.networking.hostId = "8425e349"; extraSystemConfig = { networking.hostId = "8425e349"; + # It looks like the 60s of NixOS is sometimes not enough for our virtio-based zpool. + # This fixes the flakeiness of the test. + boot.initrd.postResumeCommands = '' + for i in $(seq 1 120); do + if zpool list | grep -q zroot || zpool import -N zroot; then + break + fi + done + ''; }; extraTestScript = '' def assert_property(ds, property, expected_value):