diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-09 11:35:07 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-09 11:39:31 +0200 |
commit | e2b2c726b1c1c31794d324c3afd7c24e1f953131 (patch) | |
tree | 344aa10d8659e5e701c7127d7390ff45244afb86 /server/tests | |
parent | cfb5edbd9e666b93d9680a34df59096d23d51bd5 (diff) | |
download | PeerTube-e2b2c726b1c1c31794d324c3afd7c24e1f953131.tar.gz PeerTube-e2b2c726b1c1c31794d324c3afd7c24e1f953131.tar.zst PeerTube-e2b2c726b1c1c31794d324c3afd7c24e1f953131.zip |
Fix job queue tests
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/check-params/logs.ts | 2 | ||||
-rw-r--r-- | server/tests/api/server/jobs.ts | 13 |
2 files changed, 11 insertions, 4 deletions
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 () { | |||
122 | }) | 122 | }) |
123 | 123 | ||
124 | it('Should fail with an invalid stackTrace', async function () { | 124 | it('Should fail with an invalid stackTrace', async function () { |
125 | await server.logs.createLogClient({ payload: { ...base, stackTrace: 's'.repeat(10000) }, expectedStatus }) | 125 | await server.logs.createLogClient({ payload: { ...base, stackTrace: 's'.repeat(20000) }, expectedStatus }) |
126 | }) | 126 | }) |
127 | 127 | ||
128 | it('Should fail with an invalid userAgent', async function () { | 128 | 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 () { | |||
60 | if (job.type === 'videos-views-stats') job = body.data[1] | 60 | if (job.type === 'videos-views-stats') job = body.data[1] |
61 | 61 | ||
62 | expect(job.state).to.equal('completed') | 62 | expect(job.state).to.equal('completed') |
63 | expect(job.type.startsWith('activitypub-')).to.be.true | ||
64 | expect(dateIsValid(job.createdAt as string)).to.be.true | 63 | expect(dateIsValid(job.createdAt as string)).to.be.true |
65 | expect(dateIsValid(job.processedOn as string)).to.be.true | 64 | expect(dateIsValid(job.processedOn as string)).to.be.true |
66 | expect(dateIsValid(job.finishedOn as string)).to.be.true | 65 | expect(dateIsValid(job.finishedOn as string)).to.be.true |
@@ -103,8 +102,16 @@ describe('Test jobs', function () { | |||
103 | 102 | ||
104 | await wait(5000) | 103 | await wait(5000) |
105 | 104 | ||
106 | const body = await servers[1].jobs.list({ state: 'waiting', jobType: 'video-transcoding' }) | 105 | { |
107 | expect(body.data).to.have.lengthOf(4) | 106 | const body = await servers[1].jobs.list({ state: 'waiting', jobType: 'video-transcoding' }) |
107 | // waiting includes waiting-children | ||
108 | expect(body.data).to.have.lengthOf(4) | ||
109 | } | ||
110 | |||
111 | { | ||
112 | const body = await servers[1].jobs.list({ state: 'waiting-children', jobType: 'video-transcoding' }) | ||
113 | expect(body.data).to.have.lengthOf(1) | ||
114 | } | ||
108 | }) | 115 | }) |
109 | 116 | ||
110 | it('Should resume the job queue', async function () { | 117 | it('Should resume the job queue', async function () { |