Skip to content

Commit

Permalink
Remove unnecessary container info test
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Oct 9, 2023
1 parent fb3007f commit d751b38
Showing 1 changed file with 1 addition and 38 deletions.
39 changes: 1 addition & 38 deletions nano/rpc_test/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6934,41 +6934,4 @@ TEST (rpc, confirmation_info)
ASSERT_EQ (1, representatives.size ());
ASSERT_EQ (0, response.get<unsigned> ("total_tally"));
}
}

/** Test election scheduler container object stats
* The test set the AEC size to 0 and then creates a block which gets stuck
* in the election scheduler waiting for a slot in the AEC. Then it confirms that
* the stats RPC call shows the corresponding scheduler bucket incrementing
*/
TEST (node, election_scheduler_container_info)
{
nano::test::system system;
nano::node_config node_config;
node_config.active_elections_size = 0;
nano::node_flags node_flags;
auto node = add_ipc_enabled_node (system, node_config);
auto const rpc_ctx = add_rpc (system, node);

// create a send block
auto send1 = nano::state_block_builder ()
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - 1)
.link (nano::public_key ())
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*node->work_generate_blocking (nano::dev::genesis->hash ()))
.build_shared ();

// process the block and wait for it to show up in the election scheduler
node->process_active (send1);
ASSERT_TIMELY (10s, node->scheduler.priority.size () == 1);

// now check the RPC call
boost::property_tree::ptree request;
request.put ("action", "stats");
request.put ("type", "objects");
auto response = wait_response (system, rpc_ctx, request);
auto es = response.get_child ("node").get_child ("scheduler");
}
}

0 comments on commit d751b38

Please sign in to comment.