From 7c27ccfcc95f62760894aba6226200c687a0ed00 Mon Sep 17 00:00:00 2001 From: Facundo Farall <37149322+ffarall@users.noreply.github.com> Date: Thu, 26 Dec 2024 14:41:34 -0300 Subject: [PATCH] fix: :white_check_mark: Wait for new signed up BSP to catch up to chain tip --- test/suites/integration/bsp/bsp-thresholds.test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/suites/integration/bsp/bsp-thresholds.test.ts b/test/suites/integration/bsp/bsp-thresholds.test.ts index cf231d53..b23c81e0 100644 --- a/test/suites/integration/bsp/bsp-thresholds.test.ts +++ b/test/suites/integration/bsp/bsp-thresholds.test.ts @@ -266,6 +266,7 @@ describeBspNet( bspStartingWeight: 800_000_000n }); const bspThreeApi = await BspNetTestApi.create(`ws://127.0.0.1:${rpcPort}`); + await userApi.wait.bspCatchUpToChainTip(bspThreeApi); // Wait for it to catch up to the top of the chain await userApi.wait.bspCatchUpToChainTip(bspThreeApi); @@ -303,11 +304,11 @@ describeBspNet( ); // Advance to the tick where the new BSP can volunteer - if ( - (await userApi.rpc.chain.getHeader()).number.toNumber() < highReputationBspVolunteerTick - ) { - await userApi.block.skipTo(highReputationBspVolunteerTick); - } + const currentBlockNumber = (await userApi.rpc.chain.getHeader()).number.toNumber(); + assert( + currentBlockNumber === highReputationBspVolunteerTick, + "BSP with high reputation should be able to volunteer immediately" + ); // Wait until the new BSP volunteers await userApi.wait.bspVolunteer(1);