aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-26 15:16:30 +0100
committerChocobozzz <me@florianbigard.com>2020-11-26 15:16:30 +0100
commit0e856b78e9b6aca5e6a48a04af8b747dbc69658f (patch)
tree04dba93371db2ad9a38bdb47f08bfc6226cc8696
parent7fd03a2c8f9d342927db8fcfa84c96e14a7740a2 (diff)
downloadPeerTube-0e856b78e9b6aca5e6a48a04af8b747dbc69658f.tar.gz
PeerTube-0e856b78e9b6aca5e6a48a04af8b747dbc69658f.tar.zst
PeerTube-0e856b78e9b6aca5e6a48a04af8b747dbc69658f.zip
Try to fix live test
-rw-r--r--server/tests/api/live/live.ts3
-rw-r--r--shared/extra-utils/videos/live.ts5
2 files changed, 8 insertions, 0 deletions
diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts
index 4f84882ff..f99e7ad46 100644
--- a/server/tests/api/live/live.ts
+++ b/server/tests/api/live/live.ts
@@ -39,6 +39,7 @@ import {
39 viewVideo, 39 viewVideo,
40 wait, 40 wait,
41 waitJobs, 41 waitJobs,
42 waitUntilLiveEnded,
42 waitUntilLivePublished, 43 waitUntilLivePublished,
43 waitUntilLiveStarts, 44 waitUntilLiveStarts,
44 waitUntilLog 45 waitUntilLog
@@ -587,6 +588,8 @@ describe('Test live', function () {
587 } 588 }
588 589
589 await stopFfmpeg(command) 590 await stopFfmpeg(command)
591 await waitUntilLiveEnded(servers[0].url, servers[0].accessToken, liveVideoUUID)
592
590 await waitJobs(servers) 593 await waitJobs(servers)
591 594
592 for (const stateChanges of [ localStateChanges, remoteStateChanges ]) { 595 for (const stateChanges of [ localStateChanges, remoteStateChanges ]) {
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts
index 266baaed3..346134969 100644
--- a/shared/extra-utils/videos/live.ts
+++ b/shared/extra-utils/videos/live.ts
@@ -137,6 +137,10 @@ function waitUntilLivePublished (url: string, token: string, videoId: number | s
137 return waitWhileLiveState(url, token, videoId, VideoState.PUBLISHED) 137 return waitWhileLiveState(url, token, videoId, VideoState.PUBLISHED)
138} 138}
139 139
140function waitUntilLiveEnded (url: string, token: string, videoId: number | string) {
141 return waitWhileLiveState(url, token, videoId, VideoState.LIVE_ENDED)
142}
143
140async function waitWhileLiveState (url: string, token: string, videoId: number | string, state: VideoState) { 144async function waitWhileLiveState (url: string, token: string, videoId: number | string, state: VideoState) {
141 let video: VideoDetails 145 let video: VideoDetails
142 146
@@ -185,6 +189,7 @@ export {
185 checkLiveCleanup, 189 checkLiveCleanup,
186 stopFfmpeg, 190 stopFfmpeg,
187 sendRTMPStreamInVideo, 191 sendRTMPStreamInVideo,
192 waitUntilLiveEnded,
188 waitFfmpegUntilError, 193 waitFfmpegUntilError,
189 sendRTMPStream, 194 sendRTMPStream,
190 testFfmpegStreamError 195 testFfmpegStreamError