Fixes https://pagure.io/koji/issue/2698
Despite previous work on rmtree to mitigate race conditions, there are still cases where it fails.
This PR cleans up the code a bit, adds some clearer comments on the trickier bits, and expands the unit tests to cover some race conditions.
Previous work on rmtree:
Metadata Update from @tkopecek: - Pull-request tagged with: testing-ready
It would be good if testing could include an nfs filesystem
I believe that nfs is likely required to replicate #2698. On local filesystems, calls to os.listdir('.') and os.chdir('..') appear to always succeed even when the directory is deleted out from under us. However, with nfs we'll see ESTALE errors
os.listdir('.')
os.chdir('..')
Commit 131c5fa1 fixes this pull-request
Pull-Request has been merged by tkopecek
Metadata Update from @tkopecek: - Pull-request untagged with: testing-ready - Pull-request tagged with: no_qe
Fixes https://pagure.io/koji/issue/2698
Despite previous work on rmtree to mitigate race conditions, there are still cases where it fails.
This PR cleans up the code a bit, adds some clearer comments on the trickier bits, and expands the unit tests to cover some race conditions.