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.
This commit is contained in:
Andrew Gaul 2021-10-26 23:19:14 +09:00 committed by GitHub
parent 0abeec9cae
commit 495d51113c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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}

View File

@ -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