nixos/tests/systemd: Fix x-initrd-mount flakiness#67798
Merged
disassembler merged 1 commit intoNixOS:masterfrom Aug 31, 2019
Merged
nixos/tests/systemd: Fix x-initrd-mount flakiness#67798disassembler merged 1 commit intoNixOS:masterfrom
disassembler merged 1 commit intoNixOS:masterfrom
Conversation
It turns out that checking for the last mount time of an ext4 file system isn't a very reliable way to check whether the file system was properly unmounted. When creating that test in the first place (88530e0), I was reluctant to inspect the file system when the VM is down and was searching for a way to check for a clean unmount *after* the file system was mounted again to make sure we don't need to create a 512 MB raw image on the host. Fortunately however, when converting from qcow2, qemu-img actually writes a sparse file, so for most file systems (that is, file systems supporting sparse files) this shouldn't waste a lot of disk space. So when investigating the flakiness, I found that whenever the test is failing, the unmount of /test-x-initrd-mount was done *before* the final step during which systemd remounts+unmounts all the remaining file systems. I haven't investigated why this is the case, but the test is a regression test for NixOS#35268, which actually didn't unmount the file system *at* *all*, so really all we need to take care here is whether the unmount has happened and not *how*. To make sure that checking the filesystem state is enough for this, I temporarily replaced the $machine->shutdown call with $machine->crash and verified that the file system state is "not clean". Signed-off-by: aszlig <aszlig@nix.build> Fixes: NixOS#67555
Member
Author
|
@GrahamcOfBorg test systemd |
Member
Author
|
The test failure on |
disassembler
approved these changes
Aug 31, 2019
Member
|
as the failure is unrelated and already in master, merging. |
10 tasks
dtzWill
pushed a commit
to dtzWill/nixpkgs
that referenced
this pull request
Sep 11, 2019
It turns out that checking for the last mount time of an ext4 file system isn't a very reliable way to check whether the file system was properly unmounted. When creating that test in the first place (88530e0), I was reluctant to inspect the file system when the VM is down and was searching for a way to check for a clean unmount *after* the file system was mounted again to make sure we don't need to create a 512 MB raw image on the host. Fortunately however, when converting from qcow2, qemu-img actually writes a sparse file, so for most file systems (that is, file systems supporting sparse files) this shouldn't waste a lot of disk space. So when investigating the flakiness, I found that whenever the test is failing, the unmount of /test-x-initrd-mount was done *before* the final step during which systemd remounts+unmounts all the remaining file systems. I haven't investigated why this is the case, but the test is a regression test for NixOS#35268, which actually didn't unmount the file system *at* *all*, so really all we need to take care here is whether the unmount has happened and not *how*. To make sure that checking the filesystem state is enough for this, I temporarily replaced the $machine->shutdown call with $machine->crash and verified that the file system state is "not clean". Signed-off-by: aszlig <aszlig@nix.build> Fixes: NixOS#67555 (cherry picked from commit d7c7fc4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It turns out that checking for the last mount time of an ext4 file system isn't a very reliable way to check whether the file system was properly unmounted.
When creating that test in the first place (88530e0), I was reluctant to inspect the file system when the VM is down and was searching for a way to check for a clean unmount after the file system was mounted again to make sure we don't need to create a 512 MB raw image on the host.
Fortunately however, when converting from qcow2,
qemu-imgactually writes a sparse file, so for most file systems (that is, file systems supporting sparse files) this shouldn't waste a lot of disk space.So when investigating the flakiness, I found that whenever the test is failing, the unmount of
/test-x-initrd-mountwas done before the final step during which systemd remounts+unmounts all the remaining file systems.I haven't investigated why this is the case, but the test is a regression test for #35268, which actually didn't unmount the file system at all, so really all we need to take care here is whether the unmount has happened and not how.
To make sure that checking the filesystem state is enough for this, I temporarily replaced the
$machine->shutdowncall with$machine->crashand verified that the file system state isnot clean.Fixes: #67555