aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/live
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-05-25 14:54:16 +0200
committerChocobozzz <me@florianbigard.com>2022-05-25 14:54:16 +0200
commit5333788c08ab6152303829d4624774b5d788ff40 (patch)
tree0377ba8504e798f71018a771742ac8d6bdbf6b51 /server/tests/api/live
parentb34ee7fa5f6558bd6fb870756ace1cd12e40e94c (diff)
downloadPeerTube-5333788c08ab6152303829d4624774b5d788ff40.tar.gz
PeerTube-5333788c08ab6152303829d4624774b5d788ff40.tar.zst
PeerTube-5333788c08ab6152303829d4624774b5d788ff40.zip
Fix saving permanent live replay on quick restream
Diffstat (limited to 'server/tests/api/live')
-rw-r--r--server/tests/api/live/live-save-replay.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts
index 7ddcb04ef..007af51e9 100644
--- a/server/tests/api/live/live-save-replay.ts
+++ b/server/tests/api/live/live-save-replay.ts
@@ -441,6 +441,40 @@ describe('Save replay setting', function () {
441 await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404) 441 await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404)
442 await checkLiveCleanup(servers[0], liveVideoUUID, []) 442 await checkLiveCleanup(servers[0], liveVideoUUID, [])
443 }) 443 })
444
445 it('Should correctly save replays with multiple sessions', async function () {
446 this.timeout(120000)
447
448 liveVideoUUID = await createLiveWrapper({ permanent: true, replay: true })
449 await waitJobs(servers)
450
451 // Streaming session #1
452 ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: liveVideoUUID })
453 await waitUntilLivePublishedOnAllServers(servers, liveVideoUUID)
454 await stopFfmpeg(ffmpegCommand)
455 await servers[0].live.waitUntilWaiting({ videoId: liveVideoUUID })
456
457 // Streaming session #2
458 ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: liveVideoUUID })
459 await waitUntilLivePublishedOnAllServers(servers, liveVideoUUID)
460 await stopFfmpeg(ffmpegCommand)
461 await waitUntilLiveWaitingOnAllServers(servers, liveVideoUUID)
462
463 // Wait for replays
464 await waitJobs(servers)
465
466 const { total, data: sessions } = await servers[0].live.listSessions({ videoId: liveVideoUUID })
467
468 expect(total).to.equal(2)
469 expect(sessions).to.have.lengthOf(2)
470
471 for (const session of sessions) {
472 expect(session.error).to.be.null
473 expect(session.replayVideo).to.exist
474
475 await servers[0].videos.get({ id: session.replayVideo.uuid })
476 }
477 })
444 }) 478 })
445 479
446 after(async function () { 480 after(async function () {