uutils / uutils/coreutils

GNU `tests/rm/rm2.sh` intermittent

Open
#4,077 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

wontfix
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.