From c81a805fe6da2536a92de27d546b015da9a9d03d Mon Sep 17 00:00:00 2001 From: Aaron Gao Date: Fri, 31 Mar 2017 14:51:19 -0700 Subject: [PATCH] test db existence on the remote host Summary: Fix the bug that previous test existence locally Closes https://github.com/facebook/rocksdb/pull/2074 Differential Revision: D4813631 Pulled By: lightmark fbshipit-source-id: eceb0d9 --- tools/regression_test.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/regression_test.sh b/tools/regression_test.sh index 96cb07d86..350b2548d 100755 --- a/tools/regression_test.sh +++ b/tools/regression_test.sh @@ -126,13 +126,11 @@ function main { if [ $TEST_MODE -le 1 ]; then tmp=$DB_PATH DB_PATH=$ORIGIN_PATH - if [ ! -e $DB_PATH ]; then + run_remote "test -d $DB_PATH" + if [[ $? -ne 0 ]] || [[ $(run_remote 'echo $(( $(date +"%s") - $(stat -c "%Y" '"$a"') ))') -gt "604800" ]]; then + rm -rf "$DB_PATH" echo "Building DB..." run_db_bench "fillseqdeterministic" $NUM_KEYS 1 0 - elif [[ ! -d $DB_PATH ]] || [[ "$(( $(date +"%s") - $(stat -c "%Y" $DB_PATH) ))" -gt "604800" ]]; then - echo "Rebuilding DB..." - rm -rf $DB_PATH - run_db_bench "fillseqdeterministic" $NUM_KEYS 1 0 fi DB_PATH=$tmp fi