From 51081c9b45f4342f9493edcd8103a63cd75f5d38 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 3 Sep 2023 02:12:50 +0300 Subject: [PATCH] Put etcd into tmpfs for tests --- tests/common.sh | 5 ++++- tests/test_write.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/common.sh b/tests/common.sh index 5e559a05..84e64399 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -27,6 +27,7 @@ ETCD_COUNT=${ETCD_COUNT:-1} if [ "$KEEP_DATA" = "" ]; then rm -rf ./testdata + rm -rf /run/user/$(id -u)/testdata_etcd* mkdir -p ./testdata fi @@ -41,7 +42,9 @@ ETCDCTL="${ETCD}ctl --endpoints=$ETCD_URL --dial-timeout=5s --command-timeout=10 start_etcd() { local i=$1 - ionice -c2 -n0 $ETCD -name etcd$i --data-dir ./testdata/etcd$i \ + local t=/run/user/$(id -u) + findmnt $t >/dev/null || (sudo mkdir -p $t && sudo mount -t tmpfs tmpfs $t) + ionice -c2 -n0 $ETCD -name etcd$i --data-dir /run/user/$(id -u)/testdata_etcd$i \ --advertise-client-urls http://$ETCD_IP:$((ETCD_PORT+2*i-2)) --listen-client-urls http://$ETCD_IP:$((ETCD_PORT+2*i-2)) \ --initial-advertise-peer-urls http://$ETCD_IP:$((ETCD_PORT+2*i-1)) --listen-peer-urls http://$ETCD_IP:$((ETCD_PORT+2*i-1)) \ --initial-cluster-token vitastor-tests-etcd --initial-cluster-state new \ diff --git a/tests/test_write.sh b/tests/test_write.sh index c16b52e6..bde4421f 100755 --- a/tests/test_write.sh +++ b/tests/test_write.sh @@ -10,7 +10,7 @@ check_qemu LD_PRELOAD="build/src/libfio_vitastor.so" \ fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=68k -direct=1 -numjobs=16 -iodepth=4 \ - -rw=randwrite -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -runtime=10 + -rw=randwrite -etcd=$ETCD_URL -pool=1 -inode=1 -size=128M -runtime=10 -osd_trace=1 # A lot of parallel syncs was crashing the primary OSD at some point