diff --git a/test/ibc.test.ts b/test/ibc.test.ts index 876051d3..68e47114 100644 --- a/test/ibc.test.ts +++ b/test/ibc.test.ts @@ -30,7 +30,7 @@ import { createIbcChannel, createIbcConnection, loopRelayer, - passParameterChangeProposal, + passParameterChangeProposal, sleep, turnIbcSwitchOff, turnIbcSwitchOn, waitForChainToStart, @@ -420,9 +420,17 @@ describe("ibcResponses", () => { } expect(tx.code).toBe(TxResultCode.Success); - const txs = await secretjs.query.txsQuery( - `tx.hash='${tx.transactionHash}'`, - ); + let txs: TxResponse[] = []; + let tries = 4; + while (txs?.length === 0 && tries > 0) { + // since this is immediately after tx broadcast, + // give some time for it to register in the node + await sleep(150); + txs = await secretjs.query.txsQuery( + `tx.hash='${tx.transactionHash}'`, + ); + tries--; + } expect(txs.length).toBe(1); expect(txs[0].ibcResponses.length).toBe(0);