aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/live/live-save-replay.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/live/live-save-replay.ts')
-rw-r--r--server/tests/api/live/live-save-replay.ts29
1 files changed, 21 insertions, 8 deletions
diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts
index 757e11845..6dd6fb44e 100644
--- a/server/tests/api/live/live-save-replay.ts
+++ b/server/tests/api/live/live-save-replay.ts
@@ -4,6 +4,7 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { FfmpegCommand } from 'fluent-ffmpeg' 5import { FfmpegCommand } from 'fluent-ffmpeg'
6import { LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState } from '@shared/models' 6import { LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState } from '@shared/models'
7import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
7import { 8import {
8 addVideoToBlacklist, 9 addVideoToBlacklist,
9 checkLiveCleanup, 10 checkLiveCleanup,
@@ -23,9 +24,9 @@ import {
23 updateCustomSubConfig, 24 updateCustomSubConfig,
24 updateVideo, 25 updateVideo,
25 waitJobs, 26 waitJobs,
27 waitUntilLiveEnded,
26 waitUntilLivePublished 28 waitUntilLivePublished
27} from '../../../../shared/extra-utils' 29} from '../../../../shared/extra-utils'
28import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
29 30
30const expect = chai.expect 31const expect = chai.expect
31 32
@@ -74,6 +75,12 @@ describe('Save replay setting', function () {
74 } 75 }
75 } 76 }
76 77
78 async function waitUntilLivePublishedOnAllServers (videoId: string) {
79 for (const server of servers) {
80 await waitUntilLivePublished(server.url, server.accessToken, videoId)
81 }
82 }
83
77 before(async function () { 84 before(async function () {
78 this.timeout(120000) 85 this.timeout(120000)
79 86
@@ -125,10 +132,11 @@ describe('Save replay setting', function () {
125 }) 132 })
126 133
127 it('Should correctly have updated the live and federated it when streaming in the live', async function () { 134 it('Should correctly have updated the live and federated it when streaming in the live', async function () {
128 this.timeout(20000) 135 this.timeout(30000)
129 136
130 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID) 137 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
131 await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoUUID) 138
139 await waitUntilLivePublishedOnAllServers(liveVideoUUID)
132 140
133 await waitJobs(servers) 141 await waitJobs(servers)
134 142
@@ -141,6 +149,9 @@ describe('Save replay setting', function () {
141 149
142 await stopFfmpeg(ffmpegCommand) 150 await stopFfmpeg(ffmpegCommand)
143 151
152 for (const server of servers) {
153 await waitUntilLiveEnded(server.url, server.accessToken, liveVideoUUID)
154 }
144 await waitJobs(servers) 155 await waitJobs(servers)
145 156
146 // Live still exist, but cannot be played anymore 157 // Live still exist, but cannot be played anymore
@@ -159,7 +170,8 @@ describe('Save replay setting', function () {
159 liveVideoUUID = await createLiveWrapper(false) 170 liveVideoUUID = await createLiveWrapper(false)
160 171
161 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID) 172 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
162 await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoUUID) 173
174 await waitUntilLivePublishedOnAllServers(liveVideoUUID)
163 175
164 await waitJobs(servers) 176 await waitJobs(servers)
165 await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) 177 await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200)
@@ -185,7 +197,8 @@ describe('Save replay setting', function () {
185 liveVideoUUID = await createLiveWrapper(false) 197 liveVideoUUID = await createLiveWrapper(false)
186 198
187 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID) 199 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
188 await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoUUID) 200
201 await waitUntilLivePublishedOnAllServers(liveVideoUUID)
189 202
190 await waitJobs(servers) 203 await waitJobs(servers)
191 await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) 204 await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200)
@@ -219,7 +232,7 @@ describe('Save replay setting', function () {
219 this.timeout(20000) 232 this.timeout(20000)
220 233
221 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID) 234 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
222 await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoUUID) 235 await waitUntilLivePublishedOnAllServers(liveVideoUUID)
223 236
224 await waitJobs(servers) 237 await waitJobs(servers)
225 238
@@ -262,7 +275,7 @@ describe('Save replay setting', function () {
262 liveVideoUUID = await createLiveWrapper(true) 275 liveVideoUUID = await createLiveWrapper(true)
263 276
264 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID) 277 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
265 await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoUUID) 278 await waitUntilLivePublishedOnAllServers(liveVideoUUID)
266 279
267 await waitJobs(servers) 280 await waitJobs(servers)
268 await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) 281 await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200)
@@ -288,7 +301,7 @@ describe('Save replay setting', function () {
288 liveVideoUUID = await createLiveWrapper(true) 301 liveVideoUUID = await createLiveWrapper(true)
289 302
290 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID) 303 ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
291 await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoUUID) 304 await waitUntilLivePublishedOnAllServers(liveVideoUUID)
292 305
293 await waitJobs(servers) 306 await waitJobs(servers)
294 await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) 307 await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200)