Skip to content

Commit

Permalink
AntelopeIOGH-1251 Fix tests to not destroy temp dir before controller…
Browse files Browse the repository at this point in the history
… which uses it
  • Loading branch information
heifner committed Jun 29, 2023
1 parent 7c43e00 commit cd744f5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions libraries/chain/webassembly/runtimes/eos-vm-oc/code_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,6 @@ code_cache_base::code_cache_base(const std::filesystem::path data_dir, const eos
}

void code_cache_base::set_on_disk_region_dirty(bool dirty) {
// tests can remove directory before destructor is called
if (!std::filesystem::exists(_cache_file_path)) {
wlog("Unable to sync code cache, cache file does not exist");
return;
}

bip::file_mapping dirty_mapping(_cache_file_path.generic_string().c_str(), bip::read_write);
bip::mapped_region dirty_region(dirty_mapping, bip::read_write);

Expand Down
2 changes: 1 addition & 1 deletion plugins/chain_plugin/test/plugin_config_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <stdint.h>

BOOST_AUTO_TEST_CASE(chain_plugin_default_tests) {
appbase::scoped_app app;
fc::temp_directory tmp;
appbase::scoped_app app;

auto tmp_path = tmp.path().string();
std::array args = {
Expand Down
4 changes: 2 additions & 2 deletions plugins/producer_plugin/test/test_read_only_trx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ BOOST_AUTO_TEST_SUITE(read_only_trxs)
enum class app_init_status { failed, succeeded };

void test_configs_common(std::vector<const char*>& specific_args, app_init_status expected_status) {
appbase::scoped_app app;
fc::temp_directory temp;
appbase::scoped_app app;
auto temp_dir_str = temp.path().string();

fc::logger::get(DEFAULT_LOGGER).set_log_level(fc::log_level::debug);
Expand Down Expand Up @@ -92,8 +92,8 @@ BOOST_AUTO_TEST_CASE(not_check_configs_if_no_read_only_threads) {

void test_trxs_common(std::vector<const char*>& specific_args) {
using namespace std::chrono_literals;
appbase::scoped_app app;
fc::temp_directory temp;
appbase::scoped_app app;
auto temp_dir_str = temp.path().string();
producer_plugin::set_test_mode(true);

Expand Down
2 changes: 1 addition & 1 deletion plugins/producer_plugin/test/test_trx_full.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ BOOST_AUTO_TEST_SUITE(ordered_trxs_full)
// Test verifies that transactions are processed, reported to caller, and not lost
// even when blocks are aborted and some transactions fail.
BOOST_AUTO_TEST_CASE(producer) {
fc::temp_directory temp;
appbase::scoped_app app;

fc::temp_directory temp;
auto temp_dir_str = temp.path().string();

{
Expand Down

0 comments on commit cd744f5

Please sign in to comment.