]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live-fast-restream.ts
Also retry when fetching master m3u8 playlist
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live-fast-restream.ts
index 4b5d041eca5471ab06e0b02734c52cc29d75fa2e..3ea6be9ff8a3275faac9e84c6c9e61b332663625 100644 (file)
@@ -1,7 +1,6 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
 import { wait } from '@shared/core-utils'
 import { HttpStatusCode, LiveVideoCreate, VideoPrivacy } from '@shared/models'
 import {
@@ -15,8 +14,6 @@ import {
   waitJobs
 } from '@shared/server-commands'
 
-const expect = chai.expect
-
 describe('Fast restream in live', function () {
   let server: PeerTubeServer
 
@@ -57,13 +54,14 @@ describe('Fast restream in live', function () {
   }
 
   async function ensureLastLiveWorks (liveId: string) {
-    // Equivalent to PEERTUBE_TEST_CONSTANTS.VIDEO_LIVE.CLEANUP_DELAY
+    // Equivalent to PEERTUBE_TEST_CONSTANTS_VIDEO_LIVE_CLEANUP_DELAY
     for (let i = 0; i < 100; i++) {
       const video = await server.videos.get({ id: liveId })
       expect(video.streamingPlaylists).to.have.lengthOf(1)
 
-      await server.live.getSegment({ videoUUID: liveId, segment: 0, playlistNumber: 0 })
+      await server.live.getSegmentFile({ videoUUID: liveId, segment: 0, playlistNumber: 0 })
       await makeRawRequest(video.streamingPlaylists[0].playlistUrl, HttpStatusCode.OK_200)
+      await makeRawRequest(video.streamingPlaylists[0].segmentsSha256Url, HttpStatusCode.OK_200)
 
       await wait(100)
     }
@@ -101,7 +99,7 @@ describe('Fast restream in live', function () {
   before(async function () {
     this.timeout(120000)
 
-    const env = { 'PEERTUBE_TEST_CONSTANTS.VIDEO_LIVE.CLEANUP_DELAY': '10000' }
+    const env = { PEERTUBE_TEST_CONSTANTS_VIDEO_LIVE_CLEANUP_DELAY: '10000' }
     server = await createSingleServer(1, {}, { env })
 
     // Get the access tokens