From da66df80b4fed8b617828d6f4c22f9af9f024a5a Mon Sep 17 00:00:00 2001 From: Isla Koenigsknecht Date: Thu, 11 Apr 2024 17:40:42 -0400 Subject: [PATCH] Fix tests --- .../connections-manager.service.tor.spec.ts | 4 ++-- packages/e2e-tests/src/tests/multipleClients.test.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/nest/connections-manager/connections-manager.service.tor.spec.ts b/packages/backend/src/nest/connections-manager/connections-manager.service.tor.spec.ts index fb41bf4aa2..eb5d3e9ee1 100644 --- a/packages/backend/src/nest/connections-manager/connections-manager.service.tor.spec.ts +++ b/packages/backend/src/nest/connections-manager/connections-manager.service.tor.spec.ts @@ -205,8 +205,8 @@ describe('Connections manager', () => { await sleep(5000) // It looks LibP2P dials peers initially when it's started and // then IPFS service dials peers again when started, thus - // peersCount * 2 - expect(spyOnDial).toHaveBeenCalledTimes(peersCount * 2) + // peersCount-1 * 2 because we don't dial ourself (the first peer in the list) + expect(spyOnDial).toHaveBeenCalledTimes((peersCount - 1) * 2) // Temporary fix for hanging test - websocketOverTor doesn't have abortController await sleep(5000) }) diff --git a/packages/e2e-tests/src/tests/multipleClients.test.ts b/packages/e2e-tests/src/tests/multipleClients.test.ts index 11eec9b3a3..6cd7f14059 100644 --- a/packages/e2e-tests/src/tests/multipleClients.test.ts +++ b/packages/e2e-tests/src/tests/multipleClients.test.ts @@ -385,6 +385,7 @@ describe('Multiple Clients', () => { }) it("Owner doesn't see the connection status element in second channel", async () => { + await sleep(10000) const correctConnectionStatusElementPresence = await secondChannelOwner.waitForConnectionStatus(false) expect(correctConnectionStatusElementPresence).toBe(true) }) @@ -490,14 +491,14 @@ describe('Multiple Clients', () => { it('User 1 re-opens app', async () => { console.log('User 1 re-opens app') await users.user1.app?.openWithRetries() - await sleep(30000) + await sleep(35000) }) // Check correct channels replication it('User 1 sees information about recreation general channel and see correct amount of messages (#2334)', async () => { generalChannelUser1 = new Channel(users.user1.app.driver, 'general') await generalChannelUser1.element.isDisplayed() - await sleep(30000) + await sleep(40000) await generalChannelUser1.waitForUserMessage( users.owner.username,