]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live-permanent.ts
Refactor a little bit live tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live-permanent.ts
index 2701c65e3d2f8d965ed8bb9c89c7f955100c2f18..d52e8c7e4b898acbbebce83918a2bb1417ff044a 100644 (file)
@@ -8,6 +8,7 @@ import {
   createLive,
   doubleFollow,
   flushAndRunMultipleServers,
+  getCustomConfigResolutions,
   getLive,
   getPlaylistsCount,
   getVideo,
@@ -20,7 +21,8 @@ import {
   updateLive,
   wait,
   waitJobs,
-  waitUntilLivePublished
+  waitUntilLivePublished,
+  waitUntilLiveWaiting
 } from '../../../../shared/extra-utils'
 
 const expect = chai.expect
@@ -65,17 +67,10 @@ describe('Permenant live', function () {
       live: {
         enabled: true,
         allowReplay: true,
-        maxDuration: null,
+        maxDuration: -1,
         transcoding: {
           enabled: true,
-          resolutions: {
-            '240p': true,
-            '360p': true,
-            '480p': true,
-            '720p': true,
-            '1080p': true,
-            '2160p': true
-          }
+          resolutions: getCustomConfigResolutions(true)
         }
       }
     })
@@ -111,7 +106,7 @@ describe('Permenant live', function () {
   })
 
   it('Should stream into this permanent live', async function () {
-    this.timeout(40000)
+    this.timeout(60000)
 
     const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, videoUUID)
 
@@ -122,6 +117,7 @@ describe('Permenant live', function () {
     await checkVideoState(videoUUID, VideoState.PUBLISHED)
 
     await stopFfmpeg(command)
+    await waitUntilLiveWaiting(servers[0].url, servers[0].accessToken, videoUUID)
 
     await waitJobs(servers)
   })
@@ -153,17 +149,10 @@ describe('Permenant live', function () {
       live: {
         enabled: true,
         allowReplay: true,
-        maxDuration: null,
+        maxDuration: -1,
         transcoding: {
           enabled: true,
-          resolutions: {
-            '240p': false,
-            '360p': false,
-            '480p': false,
-            '720p': false,
-            '1080p': false,
-            '2160p': false
-          }
+          resolutions: getCustomConfigResolutions(false)
         }
       }
     })