From 16a7665177cee0e3963f61e6f7e213abb16f2d61 Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Sat, 23 Mar 2024 16:58:01 +0100 Subject: [PATCH] fix api runtime disconnect warning --- packages/e2e/src/import-storage/index.test.ts | 2 ++ packages/e2e/src/resume.test.ts | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/packages/e2e/src/import-storage/index.test.ts b/packages/e2e/src/import-storage/index.test.ts index 84879de7..d0b43a7c 100644 --- a/packages/e2e/src/import-storage/index.test.ts +++ b/packages/e2e/src/import-storage/index.test.ts @@ -41,6 +41,8 @@ describe('import-storage', () => { await expect(overrideStorage(chain, path.join(__dirname, 'storage.error.storage.yml'))).rejects.toThrowError( 'Cannot find storage MMembers in pallet TechnicalCommittee', ) + // fixes api runtime disconnect warning + await new Promise((r) => setTimeout(r, 50)) }) it('wasm override works', async () => { diff --git a/packages/e2e/src/resume.test.ts b/packages/e2e/src/resume.test.ts index 52bfd6ef..07bb49e5 100644 --- a/packages/e2e/src/resume.test.ts +++ b/packages/e2e/src/resume.test.ts @@ -52,6 +52,8 @@ describe('resume', async () => { const loadedHead = await newAcala.chain.getBlockAt(newHeadNumber) expect(loadedHead?.hash).toEqual(savedHeadHash) + // fixes api runtime disconnect warning + await new Promise((r) => setTimeout(r, 50)) await newAcala.teardown() }) @@ -63,6 +65,8 @@ describe('resume', async () => { const newHeadNumber = newAcala.chain.head.number expect(newHeadNumber).toEqual(3000001) + // fixes api runtime disconnect warning + await new Promise((r) => setTimeout(r, 50)) await newAcala.teardown() }) @@ -75,6 +79,8 @@ describe('resume', async () => { const loadedHead = await newAcala.chain.getBlockAt(newHeadNumber) expect(loadedHead?.hash).toEqual(savedHeadHash) + // fixes api runtime disconnect warning + await new Promise((r) => setTimeout(r, 50)) await newAcala.teardown() }) @@ -96,6 +102,9 @@ describe('resume', async () => { expect(loadedAcalaHead.hash).toEqual(savedAcalaHash) expect(loadedPolkadotHead.hash).toEqual(savedPolkadotHash) + // fixes api runtime disconnect warning + await new Promise((r) => setTimeout(r, 50)) + await acala.teardown() await polkadot.teardown() })