From 15b394551164cf6866055d2eecded1c3097ca319 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Tue, 12 Jul 2022 05:44:14 +0100 Subject: [PATCH] When the node is constructed outside of a nano::system, if the test fails, the node will not be shut down and can result in other tests failing further on. --- nano/core_test/bootstrap.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nano/core_test/bootstrap.cpp b/nano/core_test/bootstrap.cpp index 51dec034c..22cbcf5de 100644 --- a/nano/core_test/bootstrap.cpp +++ b/nano/core_test/bootstrap.cpp @@ -1434,13 +1434,13 @@ TEST (bootstrap_processor, wallet_lazy_pending) .work (*node0->work_generate_blocking (receive1->hash ())) .build_shared (); - // Processing test chain + // Processing test c`hain node0->block_processor.add (send1); node0->block_processor.add (receive1); node0->block_processor.add (send2); node0->block_processor.flush (); // Start wallet lazy bootstrap - auto node1 (std::make_shared (system.io_ctx, nano::get_available_port (), nano::unique_path (), system.logging, system.work)); + auto node1 = system.add_node (); node1->network.udp_channels.insert (node0->network.endpoint (), node1->network_params.network.protocol_version); auto wallet (node1->wallets.create (nano::random_wallet_id ())); ASSERT_NE (nullptr, wallet); @@ -1448,7 +1448,6 @@ TEST (bootstrap_processor, wallet_lazy_pending) node1->bootstrap_wallet (); // Check processed blocks ASSERT_TIMELY (10s, node1->ledger.block_or_pruned_exists (send2->hash ())); - node1->stop (); } TEST (bootstrap_processor, multiple_attempts)