summaryrefslogtreecommitdiff
path: root/init.cfg
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2021-09-25 14:23:37 +0100
committerPádraig Brady <P@draigBrady.com>2021-09-25 22:40:01 +0100
commit61c81ffaacb0194dec31297bc1aa51be72315858 (patch)
tree835706429277b371b956d00dc15f66ec0be3926e /init.cfg
parente8b56ebd536e82b15542a00c888109471936bfda (diff)
downloadcoreutils-61c81ffaacb0194dec31297bc1aa51be72315858.tar.gz
tests: cp/sparse-perf: make more robust and add zfs comments
* init.cfg (seek_data_capable_): Add a timeout to ensure failure for slow lseek(...SEEK_DATA) calls (even if that syscall isn't interrupted). * tests/cp/sparse-perf.sh: Run the SEEK_DATA check on the 1TiB empty file to exclude both FreeBSD 9.1 which takes 35s, and ZFS which requires a delay of about 5s between file creation and use of SEEK_DATA to correctly determine it's empty (return ENXIO). Also remove the stat size checks as they invalidate the test due to cp never writing data due to it being always zeros, and thus converted to holes in the output.
Diffstat (limited to 'init.cfg')
-rw-r--r--init.cfg9
1 files changed, 8 insertions, 1 deletions
diff --git a/init.cfg b/init.cfg
index 714854648..b92f717f5 100644
--- a/init.cfg
+++ b/init.cfg
@@ -540,7 +540,14 @@ seek_data_capable_()
warn_ 'seek_data_capable_: python missing: assuming not SEEK_DATA capable'
return 1
fi
- $PYTHON_ "$abs_srcdir"/tests/seek-data-capable "$@"
+
+ # Use timeout if available to skip cases where SEEK_DATA takes a long time.
+ # We saw FreeBSD 9.1 take 35s to return from SEEK_DATA for a 1TiB empty file.
+ # Note lseek() is uninterruptible on FreeBSD 9.1, but it does eventually
+ # return, and the timeout will ensure a failure return from the process.
+ timeout --version >/dev/null && TIMEOUT_='timeout 10'
+
+ $TIMEOUT_ $PYTHON_ "$abs_srcdir"/tests/seek-data-capable "$@"
}
# Skip the current test if "." lacks d_type support.