From 495d51113cbe4da63493a51d47dc94145481455a Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 26 Oct 2021 23:19:14 +0900 Subject: [PATCH] Remove unneeded sleeps from tests (#1784) Also use a unique file name for every test. This ensures that tests like test_external_directory_creation and test_external_modification do not collide. --- test/integration-test-main.sh | 2 -- test/test-utils.sh | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/integration-test-main.sh b/test/integration-test-main.sh index f7eeca6..0cb7087 100755 --- a/test/integration-test-main.sh +++ b/test/integration-test-main.sh @@ -356,7 +356,6 @@ function test_external_modification { describe "Test external modification to an object ..." echo "old" > ${TEST_TEXT_FILE} OBJECT_NAME="$(basename $PWD)/${TEST_TEXT_FILE}" - sleep 2 echo "new new" | aws_cli s3 cp - "s3://${TEST_BUCKET_1}/${OBJECT_NAME}" cmp ${TEST_TEXT_FILE} <(echo "new new") rm -f ${TEST_TEXT_FILE} @@ -365,7 +364,6 @@ function test_external_modification { function test_read_external_object() { describe "create objects via aws CLI and read via s3fs ..." OBJECT_NAME="$(basename $PWD)/${TEST_TEXT_FILE}" - sleep 3 echo "test" | aws_cli s3 cp - "s3://${TEST_BUCKET_1}/${OBJECT_NAME}" cmp ${TEST_TEXT_FILE} <(echo "test") rm -f ${TEST_TEXT_FILE} diff --git a/test/test-utils.sh b/test/test-utils.sh index 18d648e..a69261d 100644 --- a/test/test-utils.sh +++ b/test/test-utils.sh @@ -235,7 +235,10 @@ function run_suite { key_prefix="testrun-$RANDOM" cd_run_dir $key_prefix for t in "${TEST_LIST[@]}"; do - $t $key_prefix; rc=$? + # Ensure test input name differs every iteration + TEST_TEXT_FILE=test-s3fs.txt-$RANDOM + $t $key_prefix && rc=$? || rc=$? + if [[ $rc == 0 ]] ; then report_pass $t else