X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Fhandle-down.ts;h=4cedeb89efd61e758e31a4626a4bafcb6b74c52c;hb=81ebea48bfba2d81e62dd7a0f01a0cadf41d2607;hp=6ca8cfb648dcc80718f576b5b9f3b937dc9dfc7b;hpb=6502c3d43e512e968ad49f5a3bc9abc302471e18;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts index 6ca8cfb64..4cedeb89e 100644 --- a/server/tests/api/server/handle-down.ts +++ b/server/tests/api/server/handle-down.ts @@ -2,6 +2,7 @@ import * as chai from 'chai' import 'mocha' +import { JobState } from '../../../../shared/models' import { VideoPrivacy } from '../../../../shared/models/videos' import { VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' import { completeVideoCheck, getVideo, immutableAssign, reRunServer, viewVideo } from '../../utils' @@ -76,7 +77,7 @@ describe('Test handle downs', function () { }) before(async function () { - this.timeout(20000) + this.timeout(30000) servers = await flushAndRunMultipleServers(2) @@ -139,12 +140,11 @@ describe('Test handle downs', function () { }) it('Should not have pending/processing jobs anymore', async function () { - const res = await getJobsListPaginationAndSort(servers[0].url, servers[0].accessToken, 0, 50, '-createdAt') - const jobs = res.body.data + const states: JobState[] = [ 'inactive', 'active' ] - for (const job of jobs) { - expect(job.state).not.to.equal('pending') - expect(job.state).not.to.equal('processing') + for (const state of states) { + const res = await getJobsListPaginationAndSort(servers[ 0 ].url, servers[ 0 ].accessToken, state,0, 50, '-createdAt') + expect(res.body.data).to.have.length(0) } }) @@ -187,10 +187,6 @@ describe('Test handle downs', function () { await wait(5000) - const res = await getVideosList(servers[1].url) - expect(res.body.data).to.be.an('array') - expect(res.body.data).to.have.lengthOf(2) - const resVideo = await getVideo(servers[1].url, videos[0].uuid) expect(resVideo.body).not.to.be.undefined