Fixed test_external_directory_creation test when cache enabled (#1885)

This commit is contained in:
Takeshi Nakatani 2022-02-13 13:32:19 +09:00 committed by GitHub
parent dbf93c0152
commit 94e8e23eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -357,6 +357,17 @@ function test_external_directory_creation {
function test_external_modification {
describe "Test external modification to an object ..."
echo "old" > "${TEST_TEXT_FILE}"
# [NOTE]
# If the stat and file cache directory are enabled, an error will
# occur if the unixtime(sec) value does not change.
# If mtime(ctime/atime) when updating from the external program
# (awscli) is the same unixtime value as immediately before, the
# cache will be read out.
# Therefore, we need to wait over 1 second here.
#
sleep 1
local OBJECT_NAME; OBJECT_NAME=$(basename "${PWD}")/"${TEST_TEXT_FILE}"
echo "new new" | aws_cli s3 cp - "s3://${TEST_BUCKET_1}/${OBJECT_NAME}"
cmp "${TEST_TEXT_FILE}" <(echo "new new")