]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live.ts
Fix typo
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live.ts
index 4095cdb1ca6b9c43b68c53d830802d9b5cd1bcc3..b96c03cf851a1a6aad60c8cfe78c2167c30b3b52 100644 (file)
@@ -3,7 +3,7 @@
 import 'mocha'
 import * as chai from 'chai'
 import { basename, join } from 'path'
-import { ffprobePromise, getVideoFileBitrate, getVideoStreamFromFile } from '@server/helpers/ffprobe-utils'
+import { ffprobePromise, getVideoStreamFromFile } from '@server/helpers/ffprobe-utils'
 import {
   checkLiveCleanupAfterSave,
   checkLiveSegmentHash,
@@ -421,6 +421,7 @@ describe('Test live', function () {
             transcoding: {
               enabled: true,
               resolutions: {
+                '144p': resolutions.includes(144),
                 '240p': resolutions.includes(240),
                 '360p': resolutions.includes(360),
                 '480p': resolutions.includes(480),
@@ -439,7 +440,7 @@ describe('Test live', function () {
     })
 
     it('Should enable transcoding without additional resolutions', async function () {
-      this.timeout(60000)
+      this.timeout(120000)
 
       liveVideoId = await createLiveWrapper(false)
 
@@ -453,7 +454,7 @@ describe('Test live', function () {
     })
 
     it('Should enable transcoding with some resolutions', async function () {
-      this.timeout(60000)
+      this.timeout(120000)
 
       const resolutions = [ 240, 480 ]
       await updateConf(resolutions)
@@ -497,7 +498,7 @@ describe('Test live', function () {
     })
 
     it('Should enable transcoding with some resolutions and correctly save them', async function () {
-      this.timeout(200000)
+      this.timeout(400_000)
 
       const resolutions = [ 240, 360, 720 ]
 
@@ -517,10 +518,16 @@ describe('Test live', function () {
 
       await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
 
-      const bitrateLimits = {
-        720: 5000 * 1000, // 60FPS
-        360: 1100 * 1000,
-        240: 600 * 1000
+      const maxBitrateLimits = {
+        720: 6500 * 1000, // 60FPS
+        360: 1250 * 1000,
+        240: 700 * 1000
+      }
+
+      const minBitrateLimits = {
+        720: 5500 * 1000,
+        360: 1000 * 1000,
+        240: 550 * 1000
       }
 
       for (const server of servers) {
@@ -560,7 +567,8 @@ describe('Test live', function () {
           const probe = await ffprobePromise(segmentPath)
           const videoStream = await getVideoStreamFromFile(segmentPath, probe)
 
-          expect(probe.format.bit_rate).to.be.below(bitrateLimits[videoStream.height])
+          expect(probe.format.bit_rate).to.be.below(maxBitrateLimits[videoStream.height])
+          expect(probe.format.bit_rate).to.be.at.least(minBitrateLimits[videoStream.height])
 
           await makeRawRequest(file.torrentUrl, HttpStatusCode.OK_200)
           await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200)