-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Cope with busy devices when creating partitions #20521
test: Cope with busy devices when creating partitions #20521
Conversation
To make sure that we catch all cases in our tests.
Some tests have not been ported to |
f6d02c7
to
8c88224
Compare
Now they have. |
Note static-code:
|
@@ -368,6 +368,39 @@ def doit(): | |||
raise | |||
self.browser.wait(doit) | |||
|
|||
# Creating and formatting a partition sometimes fails with "Device | |||
# or resource busy" when the storage stack trips over its own feet | |||
# during the process. Let's do what the user would do and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is "swear and go back to MacOS"? 😁 🙈
More seriously, feels like an OK hack in our current position. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... oh, wipefs has --lock and even documents it to be used to coordinate with udevd... let me make this libblockdev PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, flock will not protect against open returning EBUSY, because the flocking happens after open...
UDisks2 wipes a freshly created partition, and this sometimes fails with "Device or resource busy". A good fix might be to have UDisks2 retry the wiping a little bit, ut for now we do what a user would do: Format the created partition explicitly.
8c88224
to
d08853e
Compare
The Format step also ran into "Device busy" on TF rawhide, so a little delay might be in order. But now I actually hope that the device is permanently busy and we have a chance of figuring out why. |
Well, d'oh, at this point we have already waited a minute for the dialog to close, hmm. |
We also have "Device or resource busy" fomr pure command line stuff in the tests:
I wonder if there are some new kernel shenanigans similar to the ones that made us do #17798 |
It looks like the new partitions are permanently busy... let's see if we can figure out why.
Let's try avoiding scsi_debug for disks that get partitioned. |
a2ebf24
to
fb9cfa1
Compare
This seems to have worked. I can't explain it, and I am happy with that. |
UDisks2 wipes a freshly created partition, and this sometimes fails
with "Device or resource busy". A good fix might be to have UDisks2
retry the wiping a little bit, ut for now we do what a user would do:
Format the created partition explicitly.
Fixes #20520