Skip to content

Commit

Permalink
chore: add timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
janniks committed Aug 3, 2024
1 parent d3094ed commit be669f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tests/regtest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -1104,6 +1108,7 @@ describe('regtest-env pox-4', () => {
})
);

await timeout(1000);
const rewardSet = await pool.client.getRewardSet({
contractId: poxInfo.contract_id,
rewardCyleId: nextCycle,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit be669f3

Please sign in to comment.