tests: sort: avoid a failure on GNU/Hurd

On GNU/Hurd, file descriptor limits set via 'ulimit -n' seem to be
ineffective when set below the default:

    $ (ulimit -n; ulimit -n 512; ulimit -n; \
         tee $(seq 1024) < /dev/null; echo $?)
    1024
    512
    tee: 1022: Too many open files
    tee: 1023: Too many open files
    tee: 1024: Too many open files
    1

* tests/sort/sort-merge-fdlimit.sh: Don't fail if using 'ulimit -n' to
decrease the file descriptor limit is ineffective.
This commit is contained in:
Collin Funk committed 2026-09-08 23:53:25 -07:00
1 parent 1859316a9f
commit 9e4b42982a
1 file changed
+5 -1
+5 -1
View File
@@ -35,7 +35,11 @@ seq 17 >some-data
# the ATF but fail inside it.
(ulimit -n 19 && touch ulimit-worked &&
returns_ 2 sort --batch-size=20 /dev/null) || fail=1
returns_ 2 sort --batch-size=20 /dev/null) || {
# GNU/Hurd seems to ignore 'ulimit -n'. Check for that
# before failing.
(ulimit -n 0; cat /dev/null) || fail=1
}
rm ulimit-worked || skip_ 'cannot modify open file descriptor limit'
# The default batch size (nmerge) is 16.