]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live-permanent.ts
Fix tests timeout
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live-permanent.ts
index a64588ed74c1b239791baf3a3d804484bf3ce949..9e6c6cf70fe0ff9baa49c1f17dc68001eca1cb71 100644 (file)
@@ -4,7 +4,6 @@ import 'mocha'
 import * as chai from 'chai'
 import { LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState } from '@shared/models'
 import {
-  checkLiveCleanup,
   cleanupTests,
   createLive,
   doubleFollow,
@@ -21,7 +20,8 @@ import {
   updateLive,
   wait,
   waitJobs,
-  waitUntilLiveStarts
+  waitUntilLivePublished,
+  waitUntilLiveWaiting
 } from '../../../../shared/extra-utils'
 
 const expect = chai.expect
@@ -112,17 +112,18 @@ 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)
 
     for (const server of servers) {
-      await waitUntilLiveStarts(server.url, server.accessToken, videoUUID)
+      await waitUntilLivePublished(server.url, server.accessToken, videoUUID)
     }
 
     await checkVideoState(videoUUID, VideoState.PUBLISHED)
 
     await stopFfmpeg(command)
+    await waitUntilLiveWaiting(servers[0].url, servers[0].accessToken, videoUUID)
 
     await waitJobs(servers)
   })
@@ -172,7 +173,7 @@ describe('Permenant live', function () {
     const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, videoUUID)
 
     for (const server of servers) {
-      await waitUntilLiveStarts(server.url, server.accessToken, videoUUID)
+      await waitUntilLivePublished(server.url, server.accessToken, videoUUID)
     }
 
     await checkVideoState(videoUUID, VideoState.PUBLISHED)