diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index a00e7615ec..8eea57b479 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -500,8 +500,8 @@ jobs: - name: testprep run: | sudo apt-get install vmtouch - mkdir /tmp/master - mkdir /tmp/slave + mkdir /var/tmp/master + mkdir /var/tmp/slave - name: warm up run: | ./src/redis-server --daemonize yes --logfile /dev/null @@ -535,16 +535,16 @@ jobs: echo "test SAVE doesn't increase cache" CACHE0=$(grep -w file /sys/fs/cgroup/memory.stat | awk '{print $2}') echo "$CACHE0" - ./src/redis-server --daemonize yes --logfile /dev/null --dir /tmp/master --port 8080 --repl-diskless-sync no --pidfile /tmp/master/redis.pid --rdbcompression no --enable-debug-command yes + ./src/redis-server --daemonize yes --logfile /dev/null --dir /var/tmp/master --port 8080 --repl-diskless-sync no --pidfile /var/tmp/master/redis.pid --rdbcompression no --enable-debug-command yes # Runtime TSC calibration can delay startup on x86, while the daemonized # parent exits before the child listens. Wait before the first command. wait_for_redis_start 8080 ./src/redis-cli -p 8080 debug populate 10000 k 102400 - ./src/redis-server --daemonize yes --logfile /dev/null --dir /tmp/slave --port 8081 --repl-diskless-load disabled --rdbcompression no + ./src/redis-server --daemonize yes --logfile /dev/null --dir /var/tmp/slave --port 8081 --repl-diskless-load disabled --rdbcompression no wait_for_redis_start 8081 ./src/redis-cli -p 8080 save > /dev/null - VMOUT=$(vmtouch -v /tmp/master/dump.rdb) + VMOUT=$(vmtouch -v /var/tmp/master/dump.rdb) echo $VMOUT grep -q " 0%" <<< $VMOUT CACHE=$(grep -w file /sys/fs/cgroup/memory.stat | awk '{print $2}') @@ -555,10 +555,10 @@ jobs: ./src/redis-cli -p 8081 REPLICAOF 127.0.0.1 8080 > /dev/null while [ $(./src/redis-cli -p 8081 info replication | grep "master_link_status:down") ]; do sleep 1; done; sleep 1 # wait for the completion of cache reclaim bio - VMOUT=$(vmtouch -v /tmp/master/dump.rdb) + VMOUT=$(vmtouch -v /var/tmp/master/dump.rdb) echo $VMOUT grep -q " 0%" <<< $VMOUT - VMOUT=$(vmtouch -v /tmp/slave/dump.rdb) + VMOUT=$(vmtouch -v /var/tmp/slave/dump.rdb) echo $VMOUT grep -q " 0%" <<< $VMOUT CACHE=$(grep -w file /sys/fs/cgroup/memory.stat | awk '{print $2}') @@ -566,10 +566,10 @@ jobs: if [ "$(( $CACHE-$CACHE0 ))" -gt "8000000" ]; then exit 1; fi echo "test reboot doesn't increase cache" - PID=$(cat /tmp/master/redis.pid) + PID=$(cat /var/tmp/master/redis.pid) kill -15 $PID while [ -x /proc/${PID} ]; do sleep 1; done - ./src/redis-server --daemonize yes --logfile /dev/null --dir /tmp/master --port 8080 + ./src/redis-server --daemonize yes --logfile /dev/null --dir /var/tmp/master --port 8080 # The daemonized parent can exit before the child listens, so tolerate # connection failures until INFO is available, then wait for RDB loading. @@ -586,7 +586,7 @@ jobs: done sleep 1 # wait for the completion of cache reclaim bio - VMOUT=$(vmtouch -v /tmp/master/dump.rdb) + VMOUT=$(vmtouch -v /var/tmp/master/dump.rdb) echo $VMOUT grep -q " 0%" <<< $VMOUT CACHE=$(grep -w file /sys/fs/cgroup/memory.stat | awk '{print $2}') diff --git a/src/util.c b/src/util.c index 1c1912593b..e55cd16e01 100644 --- a/src/util.c +++ b/src/util.c @@ -1826,7 +1826,9 @@ static int cache_exist(int fd) { } static void test_reclaimFilePageCache(void) { - char *tmpfile = "/tmp/redis-reclaim-cache-test"; + /* Use /var/tmp: /tmp may be tmpfs, where + * POSIX_FADV_DONTNEED does not evict file pages. */ + char *tmpfile = "/var/tmp/redis-reclaim-cache-test"; int fd = open(tmpfile, O_RDWR|O_CREAT, 0644); assert(fd >= 0);