aboutsummaryrefslogtreecommitdiff
path: root/tests/core_tests
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-11-10 12:58:19 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-11-10 12:58:49 +0000
commit27522aaa124a4a84091c3afaa85898dea2251c10 (patch)
treef20944731fdfedeca2be43a0cc5e91dff5930a26 /tests/core_tests
parenta48ef0a65afd2d89b9a81479f587b5b516a31c9c (diff)
downloadmonzero-core-27522aaa124a4a84091c3afaa85898dea2251c10.tar.gz
monzero-core-27522aaa124a4a84091c3afaa85898dea2251c10.tar.xz
monzero-core-27522aaa124a4a84091c3afaa85898dea2251c10.zip
core_tests: reset thread pool between tests
Avoids a DB error (leading to an assert) where a thread uses a read txn previously created with an environment that was since closed and reopened. While this usually works since BlockchainLMDB renews txns if it detects the environment has changed, this will not work if objects end up being allocated at the same address as the previous instance, leading to stale data usage. Thanks hyc for the LMDB debugging.
Diffstat (limited to 'tests/core_tests')
-rw-r--r--tests/core_tests/chaingen.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h
index b78640dc9..fa27deee4 100644
--- a/tests/core_tests/chaingen.h
+++ b/tests/core_tests/chaingen.h
@@ -47,6 +47,7 @@
#include "include_base_utils.h"
#include "common/boost_serialization_helper.h"
#include "common/command_line.h"
+#include "common/threadpool.h"
#include "cryptonote_basic/account_boost_serialization.h"
#include "cryptonote_basic/cryptonote_basic.h"
@@ -758,6 +759,7 @@ inline bool do_replay_events_get_core(std::vector<test_event_entry>& events, cry
t_test_class validator;
bool ret = replay_events_through_core<t_test_class>(c, events, validator);
+ tools::threadpool::getInstance().recycle();
// c.deinit();
return ret;
}