aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-16 18:21:36 +0100
committerChocobozzz <me@florianbigard.com>2022-03-16 18:35:05 +0100
commit52fe4b671a20c37ae46cf88d175dd16cddfc4de7 (patch)
tree41339d83393d9e7d3ca05b66aeb9bd79c6019b2c /server/tests/api
parentf012319a644fe8d9d33f2f567fa828442a3b39fd (diff)
downloadPeerTube-52fe4b671a20c37ae46cf88d175dd16cddfc4de7.tar.gz
PeerTube-52fe4b671a20c37ae46cf88d175dd16cddfc4de7.tar.zst
PeerTube-52fe4b671a20c37ae46cf88d175dd16cddfc4de7.zip
Fix torrent creation
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/video-editor.ts5
-rw-r--r--server/tests/api/server/jobs.ts9
2 files changed, 9 insertions, 5 deletions
diff --git a/server/tests/api/check-params/video-editor.ts b/server/tests/api/check-params/video-editor.ts
index db284a3cc..1fd22c497 100644
--- a/server/tests/api/check-params/video-editor.ts
+++ b/server/tests/api/check-params/video-editor.ts
@@ -122,10 +122,11 @@ describe('Test video editor API validator', function () {
122 }) 122 })
123 123
124 it('Should fail with an already in transcoding state video', async function () { 124 it('Should fail with an already in transcoding state video', async function () {
125 await server.jobs.pauseJobQueue()
126
127 const { uuid } = await server.videos.quickUpload({ name: 'transcoded video' }) 125 const { uuid } = await server.videos.quickUpload({ name: 'transcoded video' })
128 126
127 await server.jobs.pauseJobQueue()
128 await server.videos.runTranscoding({ videoId: uuid, transcodingType: 'hls' })
129
129 await command.createEditionTasks({ 130 await command.createEditionTasks({
130 videoId: uuid, 131 videoId: uuid,
131 tasks: VideoEditorCommand.getComplexTask(), 132 tasks: VideoEditorCommand.getComplexTask(),
diff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.ts
index bd8ffe188..6cc88a123 100644
--- a/server/tests/api/server/jobs.ts
+++ b/server/tests/api/server/jobs.ts
@@ -12,6 +12,7 @@ import {
12 waitJobs 12 waitJobs
13} from '@shared/server-commands' 13} from '@shared/server-commands'
14import { wait } from '@shared/core-utils' 14import { wait } from '@shared/core-utils'
15import { uuid } from 'short-uuid'
15 16
16const expect = chai.expect 17const expect = chai.expect
17 18
@@ -95,14 +96,16 @@ describe('Test jobs', function () {
95 it('Should pause the job queue', async function () { 96 it('Should pause the job queue', async function () {
96 this.timeout(120000) 97 this.timeout(120000)
97 98
98 await servers[1].jobs.pauseJobQueue() 99 const { uuid } = await servers[1].videos.upload({ attributes: { name: 'video2' } })
100 await waitJobs(servers)
99 101
100 await servers[1].videos.upload({ attributes: { name: 'video2' } }) 102 await servers[1].jobs.pauseJobQueue()
103 await servers[1].videos.runTranscoding({ videoId: uuid, transcodingType: 'hls' })
101 104
102 await wait(5000) 105 await wait(5000)
103 106
104 const body = await servers[1].jobs.list({ state: 'waiting', jobType: 'video-transcoding' }) 107 const body = await servers[1].jobs.list({ state: 'waiting', jobType: 'video-transcoding' })
105 expect(body.data).to.have.lengthOf(1) 108 expect(body.data).to.have.lengthOf(4)
106 }) 109 })
107 110
108 it('Should resume the job queue', async function () { 111 it('Should resume the job queue', async function () {