Merge pull request #228 from CosmWasm/harden-tests

Increase tolerance for slow block creation in tests
This commit is contained in:
Simon Warta 2020-06-18 11:13:48 +02:00 committed by GitHub
commit 1303c22250
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

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

View File

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