From 7822ecbadff47fe350a483969e1e307c1c3a3ebe Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Mon, 13 May 2024 14:56:14 +0200 Subject: [PATCH] tests: always clean the test directory previously the test directory could have been left untouched before executing a test when `init.sh` was not run - and sometimes it isn't supposed to be run - which made the test suite highly stateful and thus behaving surprisingly on multiple runs. --- tests/functional/common/init.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/functional/common/init.sh b/tests/functional/common/init.sh index 9d85dba17..017179952 100755 --- a/tests/functional/common/init.sh +++ b/tests/functional/common/init.sh @@ -1,10 +1,8 @@ test -n "$TEST_ROOT" -if test -d "$TEST_ROOT"; then - chmod -R u+rw "$TEST_ROOT" - # We would delete any daemon socket, so let's stop the daemon first. - killDaemon - rm -rf "$TEST_ROOT" -fi +# We would delete any daemon socket, so let's stop the daemon first. +killDaemon +# Destroy the test directory that may have persisted from previous runs +rm -rf "$TEST_ROOT" mkdir -p "$TEST_ROOT" mkdir "$TEST_HOME"