aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-transcoder.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-13 10:06:50 +0200
committerChocobozzz <me@florianbigard.com>2018-06-13 10:22:53 +0200
commit3cd0734fd9b0ff21aaef02317a874e8f1c06e027 (patch)
tree9e8622d269919addd35b462141ab5f22236aa6f4 /server/tests/api/videos/video-transcoder.ts
parent2186386cca113506791583cb07d6ccacba7af4e0 (diff)
downloadPeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.tar.gz
PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.tar.zst
PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.zip
Improve tests when waiting pending jobs
Diffstat (limited to 'server/tests/api/videos/video-transcoder.ts')
-rw-r--r--server/tests/api/videos/video-transcoder.ts18
1 files changed, 6 insertions, 12 deletions
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index 1eace6491..2b203c26b 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -7,7 +7,6 @@ import { getVideoFileFPS } from '../../../helpers/ffmpeg-utils'
7import { 7import {
8 doubleFollow, 8 doubleFollow,
9 flushAndRunMultipleServers, 9 flushAndRunMultipleServers,
10 flushTests,
11 getMyVideos, 10 getMyVideos,
12 getVideo, 11 getVideo,
13 getVideosList, 12 getVideosList,
@@ -16,10 +15,10 @@ import {
16 ServerInfo, 15 ServerInfo,
17 setAccessTokensToServers, 16 setAccessTokensToServers,
18 uploadVideo, 17 uploadVideo,
19 wait,
20 webtorrentAdd 18 webtorrentAdd
21} from '../../utils' 19} from '../../utils'
22import { join } from 'path' 20import { join } from 'path'
21import { waitJobs } from '../../utils/server/jobs'
23 22
24const expect = chai.expect 23const expect = chai.expect
25 24
@@ -45,7 +44,7 @@ describe('Test video transcoding', function () {
45 } 44 }
46 await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes) 45 await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes)
47 46
48 await wait(10000) 47 await waitJobs(servers)
49 48
50 const res = await getVideosList(servers[0].url) 49 const res = await getVideosList(servers[0].url)
51 const video = res.body.data[0] 50 const video = res.body.data[0]
@@ -73,7 +72,7 @@ describe('Test video transcoding', function () {
73 } 72 }
74 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) 73 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes)
75 74
76 await wait(20000) 75 await waitJobs(servers)
77 76
78 const res = await getVideosList(servers[1].url) 77 const res = await getVideosList(servers[1].url)
79 78
@@ -102,7 +101,7 @@ describe('Test video transcoding', function () {
102 } 101 }
103 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) 102 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes)
104 103
105 await wait(20000) 104 await waitJobs(servers)
106 105
107 const res = await getVideosList(servers[1].url) 106 const res = await getVideosList(servers[1].url)
108 107
@@ -125,7 +124,7 @@ describe('Test video transcoding', function () {
125 124
126 await doubleFollow(servers[0], servers[1]) 125 await doubleFollow(servers[0], servers[1])
127 126
128 await wait(15000) 127 await waitJobs(servers)
129 128
130 { 129 {
131 // Upload the video, but wait transcoding 130 // Upload the video, but wait transcoding
@@ -161,7 +160,7 @@ describe('Test video transcoding', function () {
161 await getVideo(servers[0].url, videoId, 404) 160 await getVideo(servers[0].url, videoId, 404)
162 } 161 }
163 162
164 await wait(30000) 163 await waitJobs(servers)
165 164
166 for (const server of servers) { 165 for (const server of servers) {
167 const res = await getVideosList(server.url) 166 const res = await getVideosList(server.url)
@@ -179,10 +178,5 @@ describe('Test video transcoding', function () {
179 178
180 after(async function () { 179 after(async function () {
181 killallServers(servers) 180 killallServers(servers)
182
183 // Keep the logs if the test failed
184 if (this['ok']) {
185 await flushTests()
186 }
187 }) 181 })
188}) 182})