From 504296788fade866643a0ccddcd302619a779b27 Mon Sep 17 00:00:00 2001 From: theohax <81556890+theohax@users.noreply.github.com> Date: Mon, 25 Oct 2021 18:23:57 +0300 Subject: [PATCH] Disable (intermittently) failing unit tests (#3512) * Disable (intermitently) failing unit tests * Adjust test.sh bash script not to retry failed unit tests * Add comments to intermittently failing (disabled) tests with PR and issue URLs * Disable intermittently failing unit test active_transactions.confirm_active * Fix formatting * Fix build * Disable intermittently failing unit test telemetry.remove_peer_different_genesis --- ci/test.sh | 31 ++++++++------------------ nano/core_test/active_transactions.cpp | 5 ++++- nano/core_test/bootstrap.cpp | 6 ++++- nano/core_test/node.cpp | 10 +++++++-- nano/core_test/telemetry.cpp | 5 ++++- nano/node/peer_exclusion.hpp | 2 +- nano/node/repcrawler.hpp | 2 +- nano/rpc_test/rpc.cpp | 5 ++++- 8 files changed, 36 insertions(+), 30 deletions(-) diff --git a/ci/test.sh b/ci/test.sh index 5d748db0..f7226dce 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -23,7 +23,8 @@ set -o nounset set -o xtrace # Alpine doesn't offer an xvfb -xvfb_run_() { +xvfb_run_() +{ INIT_DELAY_SEC=3 Xvfb :2 -screen 0 1024x768x24 & @@ -36,33 +37,18 @@ xvfb_run_() { return ${res} } -run_tests() { - local tries try - - # when busybox pretends to be bash it needs different args - # for the timeout builtin +run_tests() +{ + # when busybox pretends to be bash it needs different args for the timeout builtin + # if [[ "${BUSYBOX_BASH}" -eq 1 ]]; then TIMEOUT_TIME_ARG="-t" else TIMEOUT_TIME_ARG="" fi - tries=(_initial_) - - for try in "${tries[@]}"; do - if [ "${try}" != '_initial_' ]; then - echo "core_test failed: ${core_test_res}, retrying (try=${try})" - - # Wait a while for sockets to be all cleaned up by the kernel - sleep $((30 + (RANDOM % 30))) - fi - - ${TIMEOUT_CMD} ${TIMEOUT_TIME_ARG} ${TIMEOUT_DEFAULT} ./core_test - core_test_res=${?} - if [ "${core_test_res}" = '0' ]; then - break - fi - done + ${TIMEOUT_CMD} ${TIMEOUT_TIME_ARG} ${TIMEOUT_DEFAULT} ./core_test + core_test_res=${?} ${TIMEOUT_CMD} ${TIMEOUT_TIME_ARG} ${TIMEOUT_DEFAULT} ./rpc_test rpc_test_res=${?} @@ -77,6 +63,7 @@ run_tests() { echo "RPC Test return code: ${rpc_test_res}" echo "QT Test return code: ${qt_test_res}" echo "Sys Test return code: ${sys_test_res}" + if [[ ${core_test_res} != 0 || ${rpc_test_res} != 0 || ${qt_test_res} != 0 || ${sys_test_res} != 0 ]]; then return 1 else diff --git a/nano/core_test/active_transactions.cpp b/nano/core_test/active_transactions.cpp index 555cc9ab..fd0888d1 100644 --- a/nano/core_test/active_transactions.cpp +++ b/nano/core_test/active_transactions.cpp @@ -11,7 +11,10 @@ using namespace std::chrono_literals; namespace nano { -TEST (active_transactions, confirm_active) +// Test disabled because it's failing intermittently. +// PR in which it got disabled: https://github.com/nanocurrency/nano-node/pull/3512 +// Issue for investigating it: https://github.com/nanocurrency/nano-node/issues/3522 +TEST (active_transactions, DISABLED_confirm_active) { nano::system system; nano::node_flags node_flags; diff --git a/nano/core_test/bootstrap.cpp b/nano/core_test/bootstrap.cpp index ea5ad1a4..8cc8a96a 100644 --- a/nano/core_test/bootstrap.cpp +++ b/nano/core_test/bootstrap.cpp @@ -404,7 +404,11 @@ TEST (bootstrap_processor, push_diamond) node1->stop (); } -TEST (bootstrap_processor, push_diamond_pruning) +// Check that an outgoing bootstrap request can push blocks +// Test disabled because it's failing intermittently. +// PR in which it got disabled: https://github.com/nanocurrency/nano-node/pull/3512 +// Issue for investigating it: https://github.com/nanocurrency/nano-node/issues/3517 +TEST (bootstrap_processor, DISABLED_push_diamond_pruning) { nano::system system; nano::node_config config (nano::get_available_port (), system.logging); diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index 6a8597e8..f283a29e 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -1682,7 +1682,10 @@ TEST (node, DISABLED_fork_stale) } } -TEST (node, broadcast_elected) +// Test disabled because it's failing intermittently. +// PR in which it got disabled: https://github.com/nanocurrency/nano-node/pull/3512 +// Issue for investigating it: https://github.com/nanocurrency/nano-node/issues/3516 +TEST (node, DISABLED_broadcast_elected) { std::vector types{ nano::transport::transport_type::tcp, nano::transport::transport_type::udp }; for (auto & type : types) @@ -1904,7 +1907,10 @@ TEST (node, DISABLED_bootstrap_no_publish) } // Check that an outgoing bootstrap request can push blocks -TEST (node, bootstrap_bulk_push) +// Test disabled because it's failing intermittently. +// PR in which it got disabled: https://github.com/nanocurrency/nano-node/pull/3512 +// Issue for investigating it: https://github.com/nanocurrency/nano-node/issues/3515 +TEST (node, DISABLED_bootstrap_bulk_push) { nano::system system0; nano::system system1; diff --git a/nano/core_test/telemetry.cpp b/nano/core_test/telemetry.cpp index ae8ebce2..1b93748f 100644 --- a/nano/core_test/telemetry.cpp +++ b/nano/core_test/telemetry.cpp @@ -545,7 +545,10 @@ TEST (telemetry, max_possible_size) namespace nano { -TEST (telemetry, remove_peer_different_genesis) +// Test disabled because it's failing intermittently. +// PR in which it got disabled: https://github.com/nanocurrency/nano-node/pull/3512 +// Issue for investigating it: https://github.com/nanocurrency/nano-node/issues/3524 +TEST (telemetry, DISABLED_remove_peer_different_genesis) { nano::system system (1); auto node0 (system.nodes[0]); diff --git a/nano/node/peer_exclusion.hpp b/nano/node/peer_exclusion.hpp index d4d6f7c5..c809bb98 100644 --- a/nano/node/peer_exclusion.hpp +++ b/nano/node/peer_exclusion.hpp @@ -52,7 +52,7 @@ public: std::size_t limited_size (std::size_t const) const; std::size_t size () const; - friend class telemetry_remove_peer_different_genesis_Test; + friend class telemetry_DISABLED_remove_peer_different_genesis_Test; friend class telemetry_remove_peer_different_genesis_udp_Test; friend class telemetry_remove_peer_invalid_signature_Test; friend class peer_exclusion_validate_Test; diff --git a/nano/node/repcrawler.hpp b/nano/node/repcrawler.hpp index 8bc435d2..7acd771b 100644 --- a/nano/node/repcrawler.hpp +++ b/nano/node/repcrawler.hpp @@ -150,7 +150,7 @@ private: /** Probable representatives */ probably_rep_t probable_reps; - friend class active_transactions_confirm_active_Test; + friend class active_transactions_DISABLED_confirm_active_Test; friend class active_transactions_confirm_frontier_Test; friend class rep_crawler_local_Test; friend class node_online_reps_rep_crawler_Test; diff --git a/nano/rpc_test/rpc.cpp b/nano/rpc_test/rpc.cpp index 823eeda3..3b02a74e 100644 --- a/nano/rpc_test/rpc.cpp +++ b/nano/rpc_test/rpc.cpp @@ -5162,7 +5162,10 @@ TEST (rpc, uptime) ASSERT_LE (1, response.get ("seconds")); } -TEST (rpc, wallet_history) +// Test disabled because it's failing intermittently. +// PR in which it got disabled: https://github.com/nanocurrency/nano-node/pull/3512 +// Issue for investigating it: https://github.com/nanocurrency/nano-node/issues/3514 +TEST (rpc, DISABLED_wallet_history) { nano::system system; nano::node_config node_config (nano::get_available_port (), system.logging);