GNU `tests/rm/rm2.sh` intermittent
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
As I understand the reason is the directory structure:
.
./a
./a/1
./a/1/2
./a/0
...
with a/1 having no execute rights. That's why a/1/2 can't be removed. We use remove_dir_all (from std::fs for linux), it tries to iterate the directory recursively and remove everything it finds, but the first time it runs into some error, it stops doing it. So, as I understand, sometimes a/0 is iterated before a/1, and sometimes vice versa, this leads to different results.
The solution could be to implement this iteration manually, not depending on remove_dir_all function. There is already some code that uses walkdir, probably it could be changed to handle both cases.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/rm/rm2.sh and reproduce its intermittent failure. Inspect the Rust rm implementation where std::fs::remove_dir_all is used, then review the existing walkdir-based code mentioned in the issue. Done means the test reliably removes the directory structure with a non-executable nested directory and passes consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100