From 65175f5cca0853c6bb07a9f377b8e39a134c8a8c Mon Sep 17 00:00:00 2001 From: Chris Guimaraes Date: Tue, 19 Sep 2023 13:15:41 +0100 Subject: [PATCH] fix: flaky test --- src/tests-2.4/pox-3-delegate-aggregation.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tests-2.4/pox-3-delegate-aggregation.ts b/src/tests-2.4/pox-3-delegate-aggregation.ts index 2fda6c1484..86d64bb9e9 100644 --- a/src/tests-2.4/pox-3-delegate-aggregation.ts +++ b/src/tests-2.4/pox-3-delegate-aggregation.ts @@ -8,9 +8,8 @@ import { standByForNextPoxCycle, standByForPoxCycle, standByForPoxCycleEnd, - standByForTx, standByForTxSuccess, - standByUntilBurnBlock, + standByUntilBlock, testEnv, } from '../test-utils/test-helpers'; import { stxToMicroStx } from '../helpers'; @@ -32,7 +31,6 @@ import { decodeClarityValue, } from 'stacks-encoding-native-js'; import { AddressStxBalanceResponse } from '@stacks/stacks-blockchain-api-types'; -import { DbTxStatus } from '../datastore/common'; describe('PoX-3 - Delegate aggregation increase operations', () => { const seedKey = testnetKeys[4].secretKey; @@ -430,6 +428,10 @@ describe('PoX-3 - Delegate aggregation increase operations', () => { }); test('Validate account balances are unlocked', async () => { + // wait another block to ensure next pox cycle is returned after + const curBlock = await testEnv.client.getInfo(); + await standByUntilBlock(curBlock.stacks_tip_height + 1); + // validate stacks-node balance const coreBalanceInfo = await testEnv.client.getAccount(delegateeAccount.stxAddr); expect(BigInt(coreBalanceInfo.locked)).toBe(0n);