From 3f655646dd76c673cb863ea73f76f5aba971cea6 Mon Sep 17 00:00:00 2001 From: Tim B <79199034+timbrinded@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:57:51 +0000 Subject: [PATCH] Fix zombienet timeouts for async branch (#2644) * timeout * fix * relaxed the test * lint --- test/suites/zombie/test_para.ts | 48 +++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/test/suites/zombie/test_para.ts b/test/suites/zombie/test_para.ts index 16bb007449..37005e0f2a 100644 --- a/test/suites/zombie/test_para.ts +++ b/test/suites/zombie/test_para.ts @@ -75,7 +75,7 @@ describeSuite({ it({ id: "T03", title: "Can connect to parachain and execute a transaction", - timeout: 60000, + timeout: 240000, test: async () => { const balBefore = (await paraApi.query.system.account(BALTATHAR_ADDRESS)).data.free; @@ -83,19 +83,39 @@ describeSuite({ context.waitBlock(5); - await new Promise((resolve) => { - paraApi.tx.balances - .transferAllowDeath(BALTATHAR_ADDRESS, ethers.parseEther("2")) - .signAndSend(charleth, ({ status, events }) => { - if (status.isInBlock) { - log("Transaction is in block"); - } - if (status.isFinalized) { - log("Transaction is finalized!"); - resolve(events); - } - }); - }); + // TODO: Renable the below when we are using polkadot 1.7.0 + // There is a discrepancy with polkadotJs and 1.3.0 + // + // await new Promise((resolve, reject) => { + // paraApi.tx.balances + // .transferAllowDeath(BALTATHAR_ADDRESS, ethers.parseEther("2")) + // .signAndSend(charleth, ({ status, events }) => { + // if (status.isInBlock) { + // log("Transaction is in block"); + // } + // if (status.isFinalized) { + // log("Transaction is finalized!"); + // resolve(events); + // } + + // if ( + // status.isDropped || + // status.isInvalid || + // status.isUsurped || + // status.isFinalityTimeout + // ) { + // reject("transaction failed!"); + // throw new Error("Transaction failed"); + // } + // }); + // }) + + await paraApi.tx.balances + .transferAllowDeath(BALTATHAR_ADDRESS, ethers.parseEther("2")) + .signAndSend(charleth); + + // TODO: Remove waitBlock below when we are using polkadot 1.7.0 + await context.waitBlock(2); const balAfter = (await paraApi.query.system.account(BALTATHAR_ADDRESS)).data.free; expect(balBefore.lt(balAfter)).to.be.true;