]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live.ts
Reload the video after waiting for the files lock
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live.ts
index ceb606af1361a212a8a91a3921b7b09ae96188f7..f9b0d257bc846c9863663e6b8dbef143358afb13 100644 (file)
@@ -2,9 +2,9 @@
 
 import { expect } from 'chai'
 import { basename, join } from 'path'
-import { ffprobePromise, getVideoStream } from '@server/helpers/ffmpeg'
-import { testImage, testVideoResolutions } from '@server/tests/shared'
+import { SQLCommand, testImage, testLiveVideoResolutions } from '@server/tests/shared'
 import { getAllFiles, wait } from '@shared/core-utils'
+import { ffprobePromise, getVideoStream } from '@shared/ffmpeg'
 import {
   HttpStatusCode,
   LiveVideo,
@@ -365,6 +365,7 @@ describe('Test live', function () {
 
   describe('Live transcoding', function () {
     let liveVideoId: string
+    let sqlCommandServer1: SQLCommand
 
     async function createLiveWrapper (saveReplay: boolean) {
       const liveAttributes = {
@@ -407,6 +408,8 @@ describe('Test live', function () {
 
     before(async function () {
       await updateConf([])
+
+      sqlCommandServer1 = new SQLCommand(servers[0])
     })
 
     it('Should enable transcoding without additional resolutions', async function () {
@@ -418,8 +421,9 @@ describe('Test live', function () {
       await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
       await waitJobs(servers)
 
-      await testVideoResolutions({
+      await testLiveVideoResolutions({
         originServer: servers[0],
+        sqlCommand: sqlCommandServer1,
         servers,
         liveVideoId,
         resolutions: [ 720 ],
@@ -453,8 +457,9 @@ describe('Test live', function () {
       await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
       await waitJobs(servers)
 
-      await testVideoResolutions({
+      await testLiveVideoResolutions({
         originServer: servers[0],
+        sqlCommand: sqlCommandServer1,
         servers,
         liveVideoId,
         resolutions: resolutions.concat([ 720 ]),
@@ -505,8 +510,9 @@ describe('Test live', function () {
       await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
       await waitJobs(servers)
 
-      await testVideoResolutions({
+      await testLiveVideoResolutions({
         originServer: servers[0],
+        sqlCommand: sqlCommandServer1,
         servers,
         liveVideoId,
         resolutions,
@@ -601,8 +607,9 @@ describe('Test live', function () {
       await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
       await waitJobs(servers)
 
-      await testVideoResolutions({
+      await testLiveVideoResolutions({
         originServer: servers[0],
+        sqlCommand: sqlCommandServer1,
         servers,
         liveVideoId,
         resolutions,
@@ -637,8 +644,9 @@ describe('Test live', function () {
       await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
       await waitJobs(servers)
 
-      await testVideoResolutions({
+      await testLiveVideoResolutions({
         originServer: servers[0],
+        sqlCommand: sqlCommandServer1,
         servers,
         liveVideoId,
         resolutions: [ 720 ],
@@ -661,6 +669,10 @@ describe('Test live', function () {
 
       expect(hlsFiles[0].resolution.id).to.equal(720)
     })
+
+    after(async function () {
+      await sqlCommandServer1.cleanup()
+    })
   })
 
   describe('After a server restart', function () {