diff --git a/test/long_stochastic.sh b/test/long_stochastic.sh index 7e59e3f9..4b99cfe4 100755 --- a/test/long_stochastic.sh +++ b/test/long_stochastic.sh @@ -176,7 +176,7 @@ function probe { echo "=============================================== $(date)" echo "${caption}: $*" rm -f ${TESTDB_DIR}/* \ - && ${VALGRIND} ./mdbx_test --ignore-dbfull --repeat=3 --pathname=${TESTDB_DIR}/long.db "$@" | lz4 > ${TESTDB_DIR}/long.log.lz4 \ + && ${VALGRIND} ./mdbx_test --ignore-dbfull --repeat=3 --pathname=${TESTDB_DIR}/long.db "$@" --cleanup-after=no | lz4 > ${TESTDB_DIR}/long.log.lz4 \ && ${VALGRIND} ./mdbx_chk -nvvv ${TESTDB_DIR}/long.db | tee ${TESTDB_DIR}/long-chk.log \ && ([ ! -e ${TESTDB_DIR}/long.db-copy ] || ${VALGRIND} ./mdbx_chk -nvvv ${TESTDB_DIR}/long.db-copy | tee ${TESTDB_DIR}/long-chk-copy.log) \ || (echo "FAILED"; exit 1) diff --git a/test/main.cc b/test/main.cc index 656d7c52..fdd59e29 100644 --- a/test/main.cc +++ b/test/main.cc @@ -209,7 +209,11 @@ std::string thunk_param(const actor_config &config) { void cleanup() { log_trace(">> cleanup"); - /* TODO: remove each database */ + for (const auto &db_path : global::databases) { + int err = osal_removefile(db_path); + if (err != MDBX_SUCCESS && err != MDBX_ENOFILE) + failure_perror(db_path.c_str(), err); + } log_trace("<< cleanup"); } @@ -587,7 +591,7 @@ int main(int argc, char *const argv[]) { } log_notice("RESULT: %s\n", failed ? "Failed" : "Successful"); - if (global::config::cleanup_before) { + if (global::config::cleanup_after) { if (failed) log_verbose("skip cleanup"); else