nixos/tests/installer: prevent race between parted and udev #47155
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.
Motivation for this change
Our installer tests still suffer from non-deterministic failure on Hydra (18.09 and master), which often delays channels.
One typical symptom of non-deterministic failure seems to be this:
Successful example:
Failed example:
The failed example looks like
udev
recognizes the new partition beforeparted
tries to tell the kernel about it. I found some reports that confirm a race betweenudev
andparted
, like this one. This can happen between separate parted calls, so it is recommended to combine multiple parted commands into a single parted call to create the correct partition layout in one pass without udev interfering.And that's what this PR does. The change itself is a series of trivial rewrites.
It should eliminate this particular cause of non-deterministic failure (but probably there are others, so don't expect zero failures from now on 馃槃).
Relevant for ZHF #45960, please backport to 18.09
WIP because I still like to run all the tests locally once, which will take some time.doneThings done