diff options
| author | Frank Ch. Eigler <[email protected]> | 2024-10-09 13:41:14 -0400 |
|---|---|---|
| committer | Frank Ch. Eigler <[email protected]> | 2024-10-10 07:49:39 -0400 |
| commit | 3dc5753b5f6f100ae24bc6ae9e4dbdb6fe44017d (patch) | |
| tree | 55205a2f0cf38f86ff764803ae6907ec4a224615 /tests | |
| parent | 3cb047b9c55c86ae613df8aacc21c517dc3fa468 (diff) | |
tests/test-subr.sh: Put test_dir under /var/tmp.
Every individual test in elfutils involves a temporary directory.
Previous version of this script put that directory under the build
tree. That's OK if it's a local disk, but if it's on NFS, then some
tests - run-large-elf-file.sh, several run-debuginfod-*.sh - take long
enough to run to fail tests intermittently.
This patch moves the temp_dir under ${TMPDIR-/var/tmp/}, so it
operates at local disk speed rather than whatever-build-filesystem
speed. Individual test scripts are all unaffected. (One could
consider /tmp instead, which is a RAM disk on modern systems, except
that some of the elfutils tests produce GB-sized temporary files.
That's probably too big for RAM.)
Signed-off-by: Frank Ch. Eigler <[email protected]>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-subr.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test-subr.sh b/tests/test-subr.sh index 411e5f28..ea80cbec 100644 --- a/tests/test-subr.sh +++ b/tests/test-subr.sh @@ -23,8 +23,9 @@ set -e # Each test runs in its own directory to make sure they can run in parallel. -test_dir="test-$$" +test_dir="${TMPDIR-/var/tmp}/elfutils-test-$$" mkdir -p "$test_dir" +orig_dir="${PWD}" cd "$test_dir" #LC_ALL=C @@ -35,7 +36,7 @@ remove_files= # Tests that trap EXIT (0) themselves should call this explicitly. exit_cleanup() { - rm -f $remove_files; cd ..; rmdir $test_dir + rm -f $remove_files; cd $orig_dir; rmdir $test_dir } trap exit_cleanup 0 |
