From 7e5fac2c34b667805486465986275882999c0abb Mon Sep 17 00:00:00 2001 From: Aaron Gao Date: Fri, 2 Jun 2017 17:12:52 -0700 Subject: [PATCH] remove test dir before exit when current regression is running Summary: clean up the current test dir if the last regression test is still running. Closes https://github.com/facebook/rocksdb/pull/2401 Differential Revision: D5177882 Pulled By: lightmark fbshipit-source-id: 91d899fcc2bde841948eae71af8584d4bdb35468 --- tools/regression_test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/regression_test.sh b/tools/regression_test.sh index 94c76db8b..9b6de63bb 100755 --- a/tools/regression_test.sh +++ b/tools/regression_test.sh @@ -114,8 +114,8 @@ PERC_PATTERN+="P99: ([0-9\.]+) P99.9: ([0-9\.]+) P99.99: ([0-9\.]+)" function main { commit=${1:-"origin/master"} - test_root_dir=${TEST_PATH:-"/tmp/rocksdb/regression_test"} - init_arguments $test_root_dir + TEST_ROOT_DIR=${TEST_PATH:-"/tmp/rocksdb/regression_test"} + init_arguments $TEST_ROOT_DIR if [ $DEBUG -eq 0 ]; then checkout_rocksdb $commit @@ -145,7 +145,7 @@ function main { run_db_bench "seekrandomwhilewriting" fi - cleanup_test_directory $test_root_dir + cleanup_test_directory $TEST_ROOT_DIR echo "" echo "Benchmark completed! Results are available in $RESULT_PATH" } @@ -258,6 +258,8 @@ function run_db_bench { if [ "$grep_output" != "" ]; then echo "Stopped regression_test.sh as there're still db_bench processes running:" echo $grep_output + echo "Clean up test directory" + cleanup_test_directory $TEST_ROOT_DIR exit 2 fi -- GitLab