diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-19 14:30:00 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-02-19 16:29:00 +0100 |
commit | 94d721efdc9a8c2cda612f49506a41adb6a06f1d (patch) | |
tree | b7f14d72b2a34471addf2d4476b777d373ed9c59 /server/tests/api/live | |
parent | d7764e2eb7e2255a42465c8b06df9a77e3710d81 (diff) | |
download | PeerTube-94d721efdc9a8c2cda612f49506a41adb6a06f1d.tar.gz PeerTube-94d721efdc9a8c2cda612f49506a41adb6a06f1d.tar.zst PeerTube-94d721efdc9a8c2cda612f49506a41adb6a06f1d.zip |
Fix stats tests
Diffstat (limited to 'server/tests/api/live')
-rw-r--r-- | server/tests/api/live/live-save-replay.ts | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts index 6dd6fb44e..61c8e74dd 100644 --- a/server/tests/api/live/live-save-replay.ts +++ b/server/tests/api/live/live-save-replay.ts | |||
@@ -23,9 +23,11 @@ import { | |||
23 | testFfmpegStreamError, | 23 | testFfmpegStreamError, |
24 | updateCustomSubConfig, | 24 | updateCustomSubConfig, |
25 | updateVideo, | 25 | updateVideo, |
26 | wait, | ||
26 | waitJobs, | 27 | waitJobs, |
27 | waitUntilLiveEnded, | 28 | waitUntilLiveEnded, |
28 | waitUntilLivePublished | 29 | waitUntilLivePublished, |
30 | waitUntilLiveSaved | ||
29 | } from '../../../../shared/extra-utils' | 31 | } from '../../../../shared/extra-utils' |
30 | 32 | ||
31 | const expect = chai.expect | 33 | const expect = chai.expect |
@@ -81,6 +83,12 @@ describe('Save replay setting', function () { | |||
81 | } | 83 | } |
82 | } | 84 | } |
83 | 85 | ||
86 | async function waitUntilLiveSavedOnAllServers (videoId: string) { | ||
87 | for (const server of servers) { | ||
88 | await waitUntilLiveSaved(server.url, server.accessToken, videoId) | ||
89 | } | ||
90 | } | ||
91 | |||
84 | before(async function () { | 92 | before(async function () { |
85 | this.timeout(120000) | 93 | this.timeout(120000) |
86 | 94 | ||
@@ -158,8 +166,6 @@ describe('Save replay setting', function () { | |||
158 | await checkVideosExist(liveVideoUUID, false, HttpStatusCode.OK_200) | 166 | await checkVideosExist(liveVideoUUID, false, HttpStatusCode.OK_200) |
159 | await checkVideoState(liveVideoUUID, VideoState.LIVE_ENDED) | 167 | await checkVideoState(liveVideoUUID, VideoState.LIVE_ENDED) |
160 | 168 | ||
161 | await waitJobs(servers) | ||
162 | |||
163 | // No resolutions saved since we did not save replay | 169 | // No resolutions saved since we did not save replay |
164 | await checkLiveCleanup(servers[0], liveVideoUUID, []) | 170 | await checkLiveCleanup(servers[0], liveVideoUUID, []) |
165 | }) | 171 | }) |
@@ -188,6 +194,8 @@ describe('Save replay setting', function () { | |||
188 | await getVideo(servers[0].url, liveVideoUUID, HttpStatusCode.UNAUTHORIZED_401) | 194 | await getVideo(servers[0].url, liveVideoUUID, HttpStatusCode.UNAUTHORIZED_401) |
189 | await getVideo(servers[1].url, liveVideoUUID, HttpStatusCode.NOT_FOUND_404) | 195 | await getVideo(servers[1].url, liveVideoUUID, HttpStatusCode.NOT_FOUND_404) |
190 | 196 | ||
197 | await wait(5000) | ||
198 | await waitJobs(servers) | ||
191 | await checkLiveCleanup(servers[0], liveVideoUUID, []) | 199 | await checkLiveCleanup(servers[0], liveVideoUUID, []) |
192 | }) | 200 | }) |
193 | 201 | ||
@@ -208,6 +216,7 @@ describe('Save replay setting', function () { | |||
208 | removeVideo(servers[0].url, servers[0].accessToken, liveVideoUUID) | 216 | removeVideo(servers[0].url, servers[0].accessToken, liveVideoUUID) |
209 | ]) | 217 | ]) |
210 | 218 | ||
219 | await wait(5000) | ||
211 | await waitJobs(servers) | 220 | await waitJobs(servers) |
212 | 221 | ||
213 | await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404) | 222 | await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404) |
@@ -245,6 +254,7 @@ describe('Save replay setting', function () { | |||
245 | 254 | ||
246 | await stopFfmpeg(ffmpegCommand) | 255 | await stopFfmpeg(ffmpegCommand) |
247 | 256 | ||
257 | await waitUntilLiveSavedOnAllServers(liveVideoUUID) | ||
248 | await waitJobs(servers) | 258 | await waitJobs(servers) |
249 | 259 | ||
250 | // Live has been transcoded | 260 | // Live has been transcoded |
@@ -292,6 +302,8 @@ describe('Save replay setting', function () { | |||
292 | await getVideo(servers[0].url, liveVideoUUID, HttpStatusCode.UNAUTHORIZED_401) | 302 | await getVideo(servers[0].url, liveVideoUUID, HttpStatusCode.UNAUTHORIZED_401) |
293 | await getVideo(servers[1].url, liveVideoUUID, HttpStatusCode.NOT_FOUND_404) | 303 | await getVideo(servers[1].url, liveVideoUUID, HttpStatusCode.NOT_FOUND_404) |
294 | 304 | ||
305 | await wait(5000) | ||
306 | await waitJobs(servers) | ||
295 | await checkLiveCleanup(servers[0], liveVideoUUID, [ 720 ]) | 307 | await checkLiveCleanup(servers[0], liveVideoUUID, [ 720 ]) |
296 | }) | 308 | }) |
297 | 309 | ||
@@ -311,6 +323,7 @@ describe('Save replay setting', function () { | |||
311 | testFfmpegStreamError(ffmpegCommand, true) | 323 | testFfmpegStreamError(ffmpegCommand, true) |
312 | ]) | 324 | ]) |
313 | 325 | ||
326 | await wait(5000) | ||
314 | await waitJobs(servers) | 327 | await waitJobs(servers) |
315 | 328 | ||
316 | await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404) | 329 | await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404) |