ZTS: fix spurious failures in mv_files #7258
Merged
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.
Fix spurious failures in mv_files.
Description
The test could fail because of a race condition between the files being generated in the background and attempting to move the files. Wait for all file generation to complete before trying to move the files around.
Also, clean up the waiting: the 'wait' command without arguments waits for all child pids. There's no need to imperfectly look to see if each pid exists and then wait for that pid explicitly. (Imperfectly: no need to look at all pids on the system with
-e
, just our own pids would have been fine, and looking for pid 123 withgrep
would find 1234 thus negating the purpose of the check).Note: the leading whitespace in this file is atrocious, but fixing it all hides what's being fixed.
Motivation and Context
Spurious failures are annoying and time wasting.
How Has This Been Tested?
Run zfs-tests
Types of changes
Checklist:
Signed-off-by
.