test: don't let the default minfreespace fail the #1693 rm -rf tests

- TEST_rm_rf_concurrent and TEST_use_dirfd_after_rmdir mounted with the
  default minfreespace of 4G. Where the test tree has less than that
  free every mkdir and create fails with ENOSPC, so they failed for a
  reason that has nothing to do with removed nodes: one with a
  traceback, the other with "No space left on device". Set
  minfreespace=0, as b0d34430 did for the EXDEV tests.
- In TEST_rm_rf_concurrent, an rm that fails without writing to stderr
  raised IndexError from taking the last line of nothing. Report the
  exit status in that case.
This commit is contained in:
Antonio S. Musumeci 2026-11-22 08:39:21 -05:00
parent 6d9b997e5d
commit ef0ab108c5
2 changed files with 9 additions and 3 deletions

View file

@ -24,7 +24,9 @@ from posix_parity import fail
from posix_parity import mergerfs_mount
OPTIONS = "defaults,cache.attr=0"
# minfreespace=0: the default 4G would fail every create with ENOSPC
# wherever the test tree has less free space.
OPTIONS = "defaults,minfreespace=0,cache.attr=0"
SECONDS = 2.0
@ -67,7 +69,9 @@ def concurrent_rm(mount):
for proc in procs:
_, err = proc.communicate()
if proc.returncode != 0:
failures[err.decode().strip().splitlines()[-1].split(": ")[-1]] += 1
lines = err.decode(errors="replace").strip().splitlines()
reason = lines[-1].split(": ")[-1] if lines else f"exit {proc.returncode}"
failures[reason] += 1
if os.path.lexists(top):
failures["left behind"] += 1
subprocess.run(["rm", "-rf", top])

View file

@ -28,7 +28,9 @@ from posix_parity import fail
from posix_parity import mergerfs_mount
OPTIONS = "defaults,use_ino,category.create=mfs,cache.attr=0"
# minfreespace=0: the default 4G would fail every create with ENOSPC
# wherever the test tree has less free space.
OPTIONS = "defaults,use_ino,category.create=mfs,minfreespace=0,cache.attr=0"
# A local filesystem returns ENOENT for these: the kernel refuses lookups
# in a removed directory. Not compared against the native run since that