From: Joel Rosdahl Date: Sun, 1 May 2022 11:15:37 +0000 (+0200) Subject: fix: Isolate inode cache file in tests X-Git-Tag: v4.6.1~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2ff4b90b8767ea0bc2d49162d85d5f08d72f24c;p=thirdparty%2Fccache.git fix: Isolate inode cache file in tests All test suites use the default temporary directory location /run/user//ccache-tmp when possible, which means that the inode cache file is shared between all test suites. This is problematic when running test suites in parallel since one test suite may run “ccache -C” (which removes the inode cache file) between two compilations in the inode_cache suite, thus making the second compilation not behave as expected, failing the test. Fix this by putting the temporary directory inside the test-specific ccache directory instead of using the default global location. Fixes #1045. --- diff --git a/test/suites/inode_cache.bash b/test/suites/inode_cache.bash index e328ac662..54dd287e8 100644 --- a/test/suites/inode_cache.bash +++ b/test/suites/inode_cache.bash @@ -4,10 +4,8 @@ SUITE_inode_cache_PROBE() { return fi - temp_dir=$(dirname $($CCACHE -k temporary_dir)) - fs=$(stat -fLc %T $temp_dir) - if [ "$fs" = "nfs" ]; then - echo "ccache temporary directory is on NFS" + if [ "$(stat -fLc %T "${CCACHE_DIR}")" = "nfs" ]; then + echo "ccache directory is on NFS" fi } @@ -15,6 +13,7 @@ SUITE_inode_cache_SETUP() { export CCACHE_INODECACHE=1 export CCACHE_DEBUG=1 unset CCACHE_NODIRECT + export CCACHE_TEMPDIR="${CCACHE_DIR}/tmp" # isolate inode cache file } SUITE_inode_cache() {