diff options
Diffstat (limited to 'server/tests/api/videos/video-transcoder.ts')
-rw-r--r-- | server/tests/api/videos/video-transcoder.ts | 18 |
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' | |||
7 | import { | 7 | import { |
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' |
22 | import { join } from 'path' | 20 | import { join } from 'path' |
21 | import { waitJobs } from '../../utils/server/jobs' | ||
23 | 22 | ||
24 | const expect = chai.expect | 23 | const 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 | }) |