From 5b99cd4faa9ef0e24a5c9cdf3973dbf56e6f2e00 Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Mon, 7 Dec 2015 14:33:24 -0500 Subject: [PATCH] Allow zero_second_vbo test to run at any timestamp #437 --- tests/tests/operation_tests2.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/tests/operation_tests2.cpp b/tests/tests/operation_tests2.cpp index 9021f621..b7e9cf11 100644 --- a/tests/tests/operation_tests2.cpp +++ b/tests/tests/operation_tests2.cpp @@ -1229,6 +1229,11 @@ BOOST_AUTO_TEST_CASE(zero_second_vbo) upgrade_to_lifetime_member(alice_id); generate_block(); + // Wait for a maintenance interval to ensure we have a full day's budget to work with. + // Otherwise we may not have enough to feed the witnesses and the worker will end up starved if we start late in the day. + generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); + generate_block(); + auto check_vesting_1b = [&](vesting_balance_id_type vbid) { // this function checks that Alice can't draw any right now, @@ -1304,8 +1309,6 @@ BOOST_AUTO_TEST_CASE(zero_second_vbo) // vote it in, wait for one maint. for vote to take effect vesting_balance_id_type vbid = wid(db).worker.get().balance; - generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); - generate_block(); // wait for another maint. for worker to be paid generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); BOOST_CHECK( vbid(db).get_allowed_withdraw(db.head_block_time()) == asset(0) );