Try to fix live test

pull/3382/head
Chocobozzz 2020-11-26 15:16:30 +01:00
parent 7fd03a2c8f
commit 0e856b78e9
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 8 additions and 0 deletions

View File

@ -39,6 +39,7 @@ import {
viewVideo, viewVideo,
wait, wait,
waitJobs, waitJobs,
waitUntilLiveEnded,
waitUntilLivePublished, waitUntilLivePublished,
waitUntilLiveStarts, waitUntilLiveStarts,
waitUntilLog waitUntilLog
@ -587,6 +588,8 @@ describe('Test live', function () {
} }
await stopFfmpeg(command) await stopFfmpeg(command)
await waitUntilLiveEnded(servers[0].url, servers[0].accessToken, liveVideoUUID)
await waitJobs(servers) await waitJobs(servers)
for (const stateChanges of [ localStateChanges, remoteStateChanges ]) { for (const stateChanges of [ localStateChanges, remoteStateChanges ]) {

View File

@ -137,6 +137,10 @@ function waitUntilLivePublished (url: string, token: string, videoId: number | s
return waitWhileLiveState(url, token, videoId, VideoState.PUBLISHED) return waitWhileLiveState(url, token, videoId, VideoState.PUBLISHED)
} }
function waitUntilLiveEnded (url: string, token: string, videoId: number | string) {
return waitWhileLiveState(url, token, videoId, VideoState.LIVE_ENDED)
}
async function waitWhileLiveState (url: string, token: string, videoId: number | string, state: VideoState) { async function waitWhileLiveState (url: string, token: string, videoId: number | string, state: VideoState) {
let video: VideoDetails let video: VideoDetails
@ -185,6 +189,7 @@ export {
checkLiveCleanup, checkLiveCleanup,
stopFfmpeg, stopFfmpeg,
sendRTMPStreamInVideo, sendRTMPStreamInVideo,
waitUntilLiveEnded,
waitFfmpegUntilError, waitFfmpegUntilError,
sendRTMPStream, sendRTMPStream,
testFfmpegStreamError testFfmpegStreamError