Skip to content

Commit

Permalink
Disable (intermittently) failing unit tests (#3512)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
theohax authored Oct 25, 2021
1 parent 9bb89ab commit 5042967
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 30 deletions.
31 changes: 9 additions & 22 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand All @@ -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=${?}
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion nano/core_test/active_transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion nano/core_test/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 8 additions & 2 deletions nano/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<nano::transport::transport_type> types{ nano::transport::transport_type::tcp, nano::transport::transport_type::udp };
for (auto & type : types)
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion nano/core_test/telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion nano/node/peer_exclusion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class peer_exclusion final
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;
Expand Down
2 changes: 1 addition & 1 deletion nano/node/repcrawler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class rep_crawler final
/** 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;
Expand Down
5 changes: 4 additions & 1 deletion nano/rpc_test/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5162,7 +5162,10 @@ TEST (rpc, uptime)
ASSERT_LE (1, response.get<int> ("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);
Expand Down

0 comments on commit 5042967

Please sign in to comment.