From be669f3be027c0cc51e53b510cb677297424e528 Mon Sep 17 00:00:00 2001 From: janniks Date: Sat, 3 Aug 2024 02:11:07 +0200 Subject: [PATCH] chore: add timeouts --- src/tests/regtest.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tests/regtest.test.ts b/src/tests/regtest.test.ts index f46c651..0225225 100644 --- a/src/tests/regtest.test.ts +++ b/src/tests/regtest.test.ts @@ -247,7 +247,6 @@ describe('regtest-env pox-4', () => { // ENSURE REWARDS const reward = (await getRewards(steph.btcAddress))[0]; - await timeout(1000); expect(reward).toBeDefined(); expect(reward.burn_block_height).toBeGreaterThan(stackHeight); }); @@ -345,6 +344,7 @@ describe('regtest-env pox-4', () => { if (ENV.SKIP_UNLOCK) return; await waitForBurnBlockHeight(info.details.unlock_height + 2); + await timeout(1000); info = await client.getStatus(); expect(info.stacked).toBeFalsy(); @@ -489,6 +489,7 @@ describe('regtest-env pox-4', () => { if (ENV.SKIP_UNLOCK) return; await waitForBurnBlockHeight(status.details.unlock_height + 2); // +1 is more correct, but often fails (race-condition?) + await timeout(1000); status = await client.getStatus(); expect(status.stacked).toBeFalsy(); @@ -638,6 +639,7 @@ describe('regtest-env pox-4', () => { if (ENV.SKIP_UNLOCK) return; await waitForBurnBlockHeight(status.details.unlock_height + 2); // +1 is more correct, but often fails (race-condition?) + await timeout(1000); status = await client.getStatus(); expect(status.stacked).toBeFalsy(); @@ -778,6 +780,7 @@ describe('regtest-env pox-4', () => { if (ENV.SKIP_UNLOCK) return; await waitForBurnBlockHeight(status.details.unlock_height + 2); // +1 is more correct, but often fails (race-condition?) + await timeout(1000); status = await client.getStatus(); expect(status.stacked).toBeFalsy(); @@ -922,6 +925,7 @@ describe('regtest-env pox-4', () => { if (ENV.SKIP_UNLOCK) return; await waitForBurnBlockHeight(status.details.unlock_height + 2); // +1 is more correct, but often fails (race-condition?) + await timeout(1000); status = await client.getStatus(); expect(status.stacked).toBeFalsy(); @@ -1104,6 +1108,7 @@ describe('regtest-env pox-4', () => { }) ); + await timeout(1000); const rewardSet = await pool.client.getRewardSet({ contractId: poxInfo.contract_id, rewardCyleId: nextCycle, @@ -1226,6 +1231,7 @@ describe('regtest-env pox-4', () => { poxInfo = await client.getPoxInfo(); await waitForNextCycle(poxInfo); + await timeout(1000); const rewardSet = await pool.client.getRewardSet({ contractId: poxInfo.contract_id, rewardCyleId: nextCycle,