On BSD systems a test may leave behind files or directories with flags such as UF_IMMUTABLE or UF_NOUNLINK set, which prevent the directory from being modified or removed. os_helper.rmtree() retries with os.chmod() but never clears the flags with os.chflags(), so it fails to remove such content.
This surfaced as a regrtest WORKER BUG on DragonFly: test_tempfile left UF_NOUNLINK-flagged directories in the worker's temporary directory (gh-154307), and the worker's os_helper.rmtree() cleanup then crashed with PermissionError, killing the workers and aborting the run.
os_helper.rmtree() should clear file flags before removing.
Linked PRs
On BSD systems a test may leave behind files or directories with flags such as
UF_IMMUTABLEorUF_NOUNLINKset, which prevent the directory from being modified or removed.os_helper.rmtree()retries withos.chmod()but never clears the flags withos.chflags(), so it fails to remove such content.This surfaced as a regrtest WORKER BUG on DragonFly:
test_tempfileleftUF_NOUNLINK-flagged directories in the worker's temporary directory (gh-154307), and the worker'sos_helper.rmtree()cleanup then crashed withPermissionError, killing the workers and aborting the run.os_helper.rmtree()should clear file flags before removing.Linked PRs