Add some tolerance for slow chains

This commit is contained in:
Simon Warta 2020-06-05 11:42:08 +02:00
parent 61d655a269
commit 2292de6e19
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ describe("CosmWasmClient", () => {
const height2 = await client.getHeight();
expect(height2).toBeGreaterThan(0);
await sleep(blockTime);
await sleep(blockTime * 1.3); // tolerate chain being 30% slower than expected
const height3 = await client.getHeight();
expect(height3).toBeGreaterThanOrEqual(height2 + 1);
expect(height3).toBeLessThanOrEqual(height2 + 2);

View File

@ -82,7 +82,7 @@ describe("CosmosClient", () => {
const height2 = await client.getHeight();
expect(height2).toBeGreaterThan(0);
await sleep(blockTime);
await sleep(blockTime * 1.3); // tolerate chain being 30% slower than expected
const height3 = await client.getHeight();
expect(height3).toBeGreaterThanOrEqual(height2 + 1);
expect(height3).toBeLessThanOrEqual(height2 + 2);