RocksDB tests (#2836)
* rocksdb test runs * Rocksdb in debug is too slow to complete on actions with windows Use relwithdebinfo instead * double deadline factor for windows tests that are slow dont duplicate win relwithdebinfo run due to debug timings on win * refactor check for TEST_USE_ROCKSDB windows actions has issues with node.bidirectional_tcp and rocksdb return early if windows and using rocksdb * formatting * double deadline factor for osx tests instead of switching to relwithdebinfo for regular test runs * guard any mdb_store based tests write out when a test is skipped for rocksdb * include ordering * additional test that shouldnt run for rocksdb mode * merge changes for Cxx17 * remove duplicate function use existing function for test guards
This commit is contained in:
parent
bc8c52a8fd
commit
9ff4428df8
11 changed files with 216 additions and 8 deletions
48
.github/workflows/rocksdb_release_tests.yml
vendored
Normal file
48
.github/workflows/rocksdb_release_tests.yml
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
name: RocksDB Release Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: '*'
|
||||
|
||||
env:
|
||||
RELEASE: 1
|
||||
artifact: 0
|
||||
TEST_USE_ROCKSDB: 1
|
||||
|
||||
jobs:
|
||||
osx_test:
|
||||
runs-on: macOS-latest
|
||||
env:
|
||||
BOOST_ROOT: /tmp/boost
|
||||
steps:
|
||||
- uses: actions/checkout@722adc6
|
||||
- name: Checkout Submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Fetch Deps
|
||||
run: TEST=1 ci/actions/osx/install_deps.sh
|
||||
- name: Run Tests
|
||||
run: ci/build-travis.sh "/tmp/qt/lib/cmake/Qt5";
|
||||
|
||||
gcc_test:
|
||||
runs-on: ubuntu-18.04
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@722adc6
|
||||
- name: Checkout Submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Fetch Deps
|
||||
run: ci/actions/linux/install_deps.sh
|
||||
- name: Run Tests
|
||||
run: docker run -e TEST_USE_ROCKSDB -v ${PWD}:/workspace nanocurrency/nano-env:gcc /bin/bash -c "cd /workspace && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/boost/lib && ldconfig && RELEASE=1 ./ci/build-travis.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5 ${PWD}"
|
||||
|
||||
clang_test:
|
||||
runs-on: ubuntu-18.04
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@722adc6
|
||||
- name: Checkout Submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Fetch Deps
|
||||
run: ci/actions/linux/install_deps.sh
|
||||
- name: Run Tests
|
||||
run: docker run -e TEST_USE_ROCKSDB -v ${PWD}:/workspace nanocurrency/nano-env:clang-6 /bin/bash -c "cd /workspace && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/boost/lib && ldconfig && RELEASE=1 ./ci/build-travis.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5 ${PWD}"
|
64
.github/workflows/rocksdb_tests.yml
vendored
Normal file
64
.github/workflows/rocksdb_tests.yml
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
name: RocksDB Tests
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
RELEASE: 0
|
||||
artifact: 0
|
||||
TEST_USE_ROCKSDB: 1
|
||||
|
||||
jobs:
|
||||
osx_test:
|
||||
runs-on: macOS-latest
|
||||
env:
|
||||
BOOST_ROOT: /tmp/boost
|
||||
DEADLINE_SCALE_FACTOR: 2
|
||||
steps:
|
||||
- uses: actions/checkout@722adc6
|
||||
- name: Checkout Submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Fetch Deps
|
||||
run: TEST=1 ci/actions/osx/install_deps.sh
|
||||
- name: Run Tests
|
||||
run: ci/build-travis.sh "/tmp/qt/lib/cmake/Qt5";
|
||||
|
||||
gcc_test:
|
||||
runs-on: ubuntu-18.04
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@722adc6
|
||||
- name: Checkout Submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Fetch Deps
|
||||
run: ci/actions/linux/install_deps.sh
|
||||
- name: Run Tests
|
||||
run: docker run -e TEST_USE_ROCKSDB -v ${PWD}:/workspace nanocurrency/nano-env:gcc /bin/bash -c "cd /workspace && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/boost/lib && ldconfig && ./ci/build-travis.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5 ${PWD}"
|
||||
|
||||
clang_test:
|
||||
runs-on: ubuntu-18.04
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@722adc6
|
||||
- name: Checkout Submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Fetch Deps
|
||||
run: ci/actions/linux/install_deps.sh
|
||||
- name: Run Tests
|
||||
run: docker run -e TEST_USE_ROCKSDB -v ${PWD}:/workspace nanocurrency/nano-env:clang-6 /bin/bash -c "cd /workspace && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/boost/lib && ldconfig && ./ci/build-travis.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5 ${PWD}"
|
||||
|
||||
windows_test:
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
RELEASE: 1
|
||||
DEADLINE_SCALE_FACTOR: 2
|
||||
steps:
|
||||
- uses: actions/checkout@722adc6
|
||||
- name: Windows Defender
|
||||
run: ci/actions/windows/disable_windows_defender.ps1
|
||||
- name: Checkout Submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Fetch Deps
|
||||
run: ci/actions/windows/install_deps.ps1
|
||||
- name: Run Tests
|
||||
run: ci/actions/windows/build.ps1
|
|
@ -1,7 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
build_dir=${1-${PWD}}
|
||||
TIMEOUT_DEFAULT=360
|
||||
if [[ ${TEST_USE_ROCKSDB-0} == 1 ]]; then
|
||||
TIMEOUT_DEFAULT=720
|
||||
else
|
||||
TIMEOUT_DEFAULT=360
|
||||
fi
|
||||
|
||||
BUSYBOX_BASH=${BUSYBOX_BASH-0}
|
||||
|
||||
|
|
|
@ -373,6 +373,11 @@ TEST (bootstrap, simple)
|
|||
|
||||
TEST (unchecked, multiple)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
nano::logger_mt logger;
|
||||
auto store = nano::make_store (logger, nano::unique_path ());
|
||||
ASSERT_TRUE (!store->init_error ());
|
||||
|
@ -654,6 +659,11 @@ TEST (block_store, latest_find)
|
|||
|
||||
TEST (mdb_block_store, supported_version_upgrades)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
// Check that upgrading from an unsupported version is not supported
|
||||
auto path (nano::unique_path ());
|
||||
nano::genesis genesis;
|
||||
|
@ -700,6 +710,11 @@ TEST (mdb_block_store, supported_version_upgrades)
|
|||
|
||||
TEST (mdb_block_store, bad_path)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
nano::logger_mt logger;
|
||||
nano::mdb_store store (logger, boost::filesystem::path ("///"));
|
||||
ASSERT_TRUE (store.init_error ());
|
||||
|
@ -1027,6 +1042,11 @@ TEST (block_store, state_block)
|
|||
|
||||
TEST (mdb_block_store, sideband_height)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
nano::logger_mt logger;
|
||||
nano::genesis genesis;
|
||||
nano::keypair key1;
|
||||
|
@ -1214,6 +1234,11 @@ TEST (block_store, online_weight)
|
|||
|
||||
TEST (mdb_block_store, upgrade_v14_v15)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
// Extract confirmation height to a separate database
|
||||
auto path (nano::unique_path ());
|
||||
nano::genesis genesis;
|
||||
|
@ -1322,6 +1347,11 @@ TEST (mdb_block_store, upgrade_v14_v15)
|
|||
|
||||
TEST (mdb_block_store, upgrade_v15_v16)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
auto path (nano::unique_path ());
|
||||
nano::mdb_val value;
|
||||
{
|
||||
|
@ -1363,6 +1393,11 @@ TEST (mdb_block_store, upgrade_v15_v16)
|
|||
|
||||
TEST (mdb_block_store, upgrade_v16_v17)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
nano::genesis genesis;
|
||||
nano::work_pool pool (std::numeric_limits<unsigned>::max ());
|
||||
nano::state_block block1 (nano::dev_genesis_key.pub, genesis.hash (), nano::dev_genesis_key.pub, nano::genesis_amount - nano::Gxrb_ratio, nano::dev_genesis_key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *pool.generate (genesis.hash ()));
|
||||
|
@ -1422,6 +1457,11 @@ TEST (mdb_block_store, upgrade_v16_v17)
|
|||
|
||||
TEST (mdb_block_store, upgrade_v17_v18)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
auto path (nano::unique_path ());
|
||||
nano::genesis genesis;
|
||||
nano::keypair key1;
|
||||
|
@ -1621,6 +1661,11 @@ TEST (mdb_block_store, upgrade_v17_v18)
|
|||
|
||||
TEST (mdb_block_store, upgrade_v18_v19)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
auto path (nano::unique_path ());
|
||||
nano::keypair key1;
|
||||
nano::work_pool pool (std::numeric_limits<unsigned>::max ());
|
||||
|
@ -1709,6 +1754,11 @@ TEST (mdb_block_store, upgrade_v18_v19)
|
|||
|
||||
TEST (mdb_block_store, upgrade_backup)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
auto dir (nano::unique_path ());
|
||||
namespace fs = boost::filesystem;
|
||||
fs::create_directory (dir);
|
||||
|
@ -1746,6 +1796,11 @@ TEST (mdb_block_store, upgrade_backup)
|
|||
// Test various confirmation height values as well as clearing them
|
||||
TEST (block_store, confirmation_height)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
auto path (nano::unique_path ());
|
||||
nano::logger_mt logger;
|
||||
auto store = nano::make_store (logger, path);
|
||||
|
|
|
@ -729,6 +729,11 @@ TEST (confirmation_height, conflict_rollback_cemented)
|
|||
|
||||
TEST (confirmation_heightDeathTest, rollback_added_block)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
// For ASSERT_DEATH_IF_SUPPORTED
|
||||
testing::FLAGS_gtest_death_test_style = "threadsafe";
|
||||
|
||||
|
@ -801,6 +806,11 @@ TEST (confirmation_height, observers)
|
|||
// This tests when a read has been done, but the block no longer exists by the time a write is done
|
||||
TEST (confirmation_heightDeathTest, modified_chain)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
// For ASSERT_DEATH_IF_SUPPORTED
|
||||
testing::FLAGS_gtest_death_test_style = "threadsafe";
|
||||
|
||||
|
@ -867,6 +877,11 @@ TEST (confirmation_heightDeathTest, modified_chain)
|
|||
// This tests when a read has been done, but the account no longer exists by the time a write is done
|
||||
TEST (confirmation_heightDeathTest, modified_chain_account_removed)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
// For ASSERT_DEATH_IF_SUPPORTED
|
||||
testing::FLAGS_gtest_death_test_style = "threadsafe";
|
||||
|
||||
|
@ -1383,6 +1398,11 @@ TEST (confirmation_height, election_winner_details_clearing_node_process_confirm
|
|||
|
||||
TEST (confirmation_height, unbounded_block_cache_iteration)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
nano::logger_mt logger;
|
||||
auto path (nano::unique_path ());
|
||||
auto store = nano::make_store (logger, path);
|
||||
|
|
|
@ -11,6 +11,11 @@ using namespace std::chrono_literals;
|
|||
// Init returns an error if it can't open files at the path
|
||||
TEST (ledger, store_error)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
nano::logger_mt logger;
|
||||
nano::mdb_store store (logger, boost::filesystem::path ("///"));
|
||||
ASSERT_TRUE (store.init_error ());
|
||||
|
|
|
@ -73,7 +73,6 @@ TEST (node_DeathTest, readonly_block_store_not_exist)
|
|||
#endif
|
||||
{
|
||||
// This is a read-only node with no ledger file
|
||||
#if NANO_ROCKSDB
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
nano::inactive_node node (nano::unique_path (), nano::inactive_node_flag_defaults ());
|
||||
|
@ -83,9 +82,6 @@ TEST (node_DeathTest, readonly_block_store_not_exist)
|
|||
{
|
||||
ASSERT_EXIT (nano::inactive_node node (nano::unique_path (), nano::inactive_node_flag_defaults ()), ::testing::ExitedWithCode (1), "");
|
||||
}
|
||||
#else
|
||||
ASSERT_EXIT (nano::inactive_node node (nano::unique_path (), nano::inactive_node_flag_defaults ()), ::testing::ExitedWithCode (1), "");
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST (node, password_fanout)
|
||||
|
@ -3686,6 +3682,13 @@ TEST (node, dont_write_lock_node)
|
|||
|
||||
TEST (node, bidirectional_tcp)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
nano::system system;
|
||||
nano::node_flags node_flags;
|
||||
// Disable bootstrap to start elections for new blocks
|
||||
|
|
|
@ -465,6 +465,11 @@ TEST (wallet, create_change)
|
|||
|
||||
TEST (history, short_text)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
nano_qt::eventloop_processor processor;
|
||||
nano::keypair key;
|
||||
nano::system system (1);
|
||||
|
|
|
@ -6751,10 +6751,9 @@ TEST (rpc, block_confirmed)
|
|||
|
||||
TEST (rpc, database_txn_tracker)
|
||||
{
|
||||
// Don't test this with the rocksdb backend
|
||||
auto use_rocksdb_str = std::getenv ("TEST_USE_ROCKSDB");
|
||||
if (use_rocksdb_str && boost::lexical_cast<int> (use_rocksdb_str) == 1)
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -914,6 +914,11 @@ TEST (confirmation_height, many_accounts_send_receive_self)
|
|||
// as opposed to active transactions which implicitly calls confirmation height processor.
|
||||
TEST (confirmation_height, many_accounts_send_receive_self_no_elections)
|
||||
{
|
||||
if (nano::using_rocksdb_in_tests ())
|
||||
{
|
||||
// Don't test this in rocksdb mode
|
||||
return;
|
||||
}
|
||||
nano::logger_mt logger;
|
||||
auto path (nano::unique_path ());
|
||||
auto store = nano::make_store (logger, path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue