Skip to content

Commit 20b2baa

Browse files
committed
fix: advance time in wait_for_rewards_minting loop
Address review comment from jasonz-dfinity: add advance_time(1s) before each tick() in wait_for_rewards_minting so that timer-based periodic tasks are also triggered, making the test more robust and realistic.
1 parent f68f96e commit 20b2baa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rs/nns/integration_tests/src/node_provider_remuneration.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,11 +1045,14 @@ fn test_automated_node_provider_remuneration() {
10451045
/// Keeps ticking the state machine until the most recent rewards timestamp changes,
10461046
/// indicating that governance completed the full minting flow (including all
10471047
/// inter-canister calls to NRC, CMC, and Ledger).
1048+
/// Each iteration advances time by 1 second so that timer-based periodic tasks
1049+
/// (if minting ever switches from heartbeat to timer) are also triggered.
10481050
fn wait_for_rewards_minting(
10491051
state_machine: &StateMachine,
10501052
previous_timestamp: u64,
10511053
) -> MonthlyNodeProviderRewards {
10521054
for i in 0..500 {
1055+
state_machine.advance_time(Duration::from_secs(1));
10531056
state_machine.tick();
10541057
if let Some(rewards) = nns_get_most_recent_monthly_node_provider_rewards(state_machine)
10551058
&& rewards.timestamp != previous_timestamp

0 commit comments

Comments
 (0)