From ddce1d3c9f5340c8a7d9055ee3d471c3cbb62604 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Tue, 26 Nov 2019 01:58:00 -0700 Subject: [PATCH] chore: make test less flaky --- web3.js/test/connection.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web3.js/test/connection.test.js b/web3.js/test/connection.test.js index 94675852c4..1728f53d68 100644 --- a/web3.js/test/connection.test.js +++ b/web3.js/test/connection.test.js @@ -426,6 +426,10 @@ test('get confirmed block', async () => { } const connection = new Connection(url); + while ((await connection.getSlot()) <= 0) { + continue; + } + // Block 0 never has any transactions in automation localnet const block0 = await connection.getConfirmedBlock(0); const blockhash0 = block0.blockhash;