From 10a72a7e617273cdbe897766f77f427eb57b689a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 28 Dec 2021 11:41:41 +0100 Subject: Fix tests --- server/tests/api/activitypub/cleaner.ts | 15 +++++++++++---- server/tests/api/server/handle-down.ts | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'server/tests') diff --git a/server/tests/api/activitypub/cleaner.ts b/server/tests/api/activitypub/cleaner.ts index dc885023a..d0a151f5c 100644 --- a/server/tests/api/activitypub/cleaner.ts +++ b/server/tests/api/activitypub/cleaner.ts @@ -291,12 +291,12 @@ describe('Test AP cleaner', function () { { const video = await servers[0].videos.get({ id: uuid }) - expect(video.likes).to.equal(3) + expect(video.likes).to.equal(2) expect(video.dislikes).to.equal(0) } { - const { total } = await servers[0].comments.listThreads({ videoId: videoUUID1 }) + const { total } = await servers[0].comments.listThreads({ videoId: uuid }) expect(total).to.equal(2) } } @@ -319,8 +319,15 @@ describe('Test AP cleaner', function () { await wait(5000) await expectNotDeleted() - await wait(15000) - await expectDeleted() + let continueWhile = true + + do { + try { + await expectDeleted() + continueWhile = false + } catch { + } + } while (continueWhile) }) after(async function () { diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts index 7c3836681..3dcd076f5 100644 --- a/server/tests/api/server/handle-down.ts +++ b/server/tests/api/server/handle-down.ts @@ -50,7 +50,7 @@ describe('Test handle downs', function () { let commentCommands: CommentsCommand[] before(async function () { - this.timeout(30000) + this.timeout(120000) servers = await createMultipleServers(3) commentCommands = servers.map(s => s.comments) -- cgit v1.2.3