X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Flive%2Flive-save-replay.ts;h=61c8e74dd4774516dc8900d15557ee9a4a0350bf;hb=94d721efdc9a8c2cda612f49506a41adb6a06f1d;hp=6dd6fb44e158d947ea6afa0d9bba8dc129751503;hpb=d7764e2eb7e2255a42465c8b06df9a77e3710d81;p=github%2FChocobozzz%2FPeerTube.git 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 { testFfmpegStreamError, updateCustomSubConfig, updateVideo, + wait, waitJobs, waitUntilLiveEnded, - waitUntilLivePublished + waitUntilLivePublished, + waitUntilLiveSaved } from '../../../../shared/extra-utils' const expect = chai.expect @@ -81,6 +83,12 @@ describe('Save replay setting', function () { } } + async function waitUntilLiveSavedOnAllServers (videoId: string) { + for (const server of servers) { + await waitUntilLiveSaved(server.url, server.accessToken, videoId) + } + } + before(async function () { this.timeout(120000) @@ -158,8 +166,6 @@ describe('Save replay setting', function () { await checkVideosExist(liveVideoUUID, false, HttpStatusCode.OK_200) await checkVideoState(liveVideoUUID, VideoState.LIVE_ENDED) - await waitJobs(servers) - // No resolutions saved since we did not save replay await checkLiveCleanup(servers[0], liveVideoUUID, []) }) @@ -188,6 +194,8 @@ describe('Save replay setting', function () { await getVideo(servers[0].url, liveVideoUUID, HttpStatusCode.UNAUTHORIZED_401) await getVideo(servers[1].url, liveVideoUUID, HttpStatusCode.NOT_FOUND_404) + await wait(5000) + await waitJobs(servers) await checkLiveCleanup(servers[0], liveVideoUUID, []) }) @@ -208,6 +216,7 @@ describe('Save replay setting', function () { removeVideo(servers[0].url, servers[0].accessToken, liveVideoUUID) ]) + await wait(5000) await waitJobs(servers) await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404) @@ -245,6 +254,7 @@ describe('Save replay setting', function () { await stopFfmpeg(ffmpegCommand) + await waitUntilLiveSavedOnAllServers(liveVideoUUID) await waitJobs(servers) // Live has been transcoded @@ -292,6 +302,8 @@ describe('Save replay setting', function () { await getVideo(servers[0].url, liveVideoUUID, HttpStatusCode.UNAUTHORIZED_401) await getVideo(servers[1].url, liveVideoUUID, HttpStatusCode.NOT_FOUND_404) + await wait(5000) + await waitJobs(servers) await checkLiveCleanup(servers[0], liveVideoUUID, [ 720 ]) }) @@ -311,6 +323,7 @@ describe('Save replay setting', function () { testFfmpegStreamError(ffmpegCommand, true) ]) + await wait(5000) await waitJobs(servers) await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404)