]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live.ts
Try to fix live test
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live.ts
index 0786db554a3469ce074b58f57c595a43a5c7f3f1..f99e7ad46649d3b95eeb5a0262ff40d8c1a66a40 100644 (file)
@@ -39,6 +39,7 @@ import {
   viewVideo,
   wait,
   waitJobs,
+  waitUntilLiveEnded,
   waitUntilLivePublished,
   waitUntilLiveStarts,
   waitUntilLog
@@ -416,7 +417,7 @@ describe('Test live', function () {
       await waitJobs(servers)
 
       const bitrateLimits = {
-        720: 3000 * 1000,
+        720: 4000 * 1000, // 60FPS
         360: 1100 * 1000,
         240: 600 * 1000
       }
@@ -436,9 +437,14 @@ describe('Test live', function () {
           const file = hlsPlaylist.files.find(f => f.resolution.id === resolution)
 
           expect(file).to.exist
-          expect(file.fps).to.be.approximately(30, 5)
           expect(file.size).to.be.greaterThan(1)
 
+          if (resolution >= 720) {
+            expect(file.fps).to.be.approximately(60, 2)
+          } else {
+            expect(file.fps).to.be.approximately(30, 2)
+          }
+
           const filename = `${video.uuid}-${resolution}-fragmented.mp4`
           const segmentPath = buildServerDirectory(servers[0], join('streaming-playlists', 'hls', video.uuid, filename))
 
@@ -582,6 +588,8 @@ describe('Test live', function () {
       }
 
       await stopFfmpeg(command)
+      await waitUntilLiveEnded(servers[0].url, servers[0].accessToken, liveVideoUUID)
+
       await waitJobs(servers)
 
       for (const stateChanges of [ localStateChanges, remoteStateChanges ]) {