From e2b2c726b1c1c31794d324c3afd7c24e1f953131 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 9 Aug 2022 11:35:07 +0200 Subject: Fix job queue tests --- server/tests/api/check-params/logs.ts | 2 +- server/tests/api/server/jobs.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'server/tests/api') diff --git a/server/tests/api/check-params/logs.ts b/server/tests/api/check-params/logs.ts index fa67408b7..f9a99796d 100644 --- a/server/tests/api/check-params/logs.ts +++ b/server/tests/api/check-params/logs.ts @@ -122,7 +122,7 @@ describe('Test logs API validators', function () { }) it('Should fail with an invalid stackTrace', async function () { - await server.logs.createLogClient({ payload: { ...base, stackTrace: 's'.repeat(10000) }, expectedStatus }) + await server.logs.createLogClient({ payload: { ...base, stackTrace: 's'.repeat(20000) }, expectedStatus }) }) it('Should fail with an invalid userAgent', async function () { diff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.ts index 96ab2a576..843e148a3 100644 --- a/server/tests/api/server/jobs.ts +++ b/server/tests/api/server/jobs.ts @@ -60,7 +60,6 @@ describe('Test jobs', function () { if (job.type === 'videos-views-stats') job = body.data[1] expect(job.state).to.equal('completed') - expect(job.type.startsWith('activitypub-')).to.be.true expect(dateIsValid(job.createdAt as string)).to.be.true expect(dateIsValid(job.processedOn as string)).to.be.true expect(dateIsValid(job.finishedOn as string)).to.be.true @@ -103,8 +102,16 @@ describe('Test jobs', function () { await wait(5000) - const body = await servers[1].jobs.list({ state: 'waiting', jobType: 'video-transcoding' }) - expect(body.data).to.have.lengthOf(4) + { + const body = await servers[1].jobs.list({ state: 'waiting', jobType: 'video-transcoding' }) + // waiting includes waiting-children + expect(body.data).to.have.lengthOf(4) + } + + { + const body = await servers[1].jobs.list({ state: 'waiting-children', jobType: 'video-transcoding' }) + expect(body.data).to.have.lengthOf(1) + } }) it('Should resume the job queue', async function () { -- cgit v1.2.3