]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live-fast-restream.ts
Merge branch 'release/5.0.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live-fast-restream.ts
index 772ea792d3c885e22fc52b594bcc5957f5b7f7ff..9e6d10dbd4cc41b3388b5e14d7410cdfd05481fa 100644 (file)
@@ -78,9 +78,15 @@ describe('Fast restream in live', function () {
       const video = await server.videos.get({ id: liveId })
       expect(video.streamingPlaylists).to.have.lengthOf(1)
 
-      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)
+      try {
+        await server.live.getSegmentFile({ videoUUID: liveId, segment: 0, playlistNumber: 0 })
+        await makeRawRequest({ url: video.streamingPlaylists[0].playlistUrl, expectedStatus: HttpStatusCode.OK_200 })
+        await makeRawRequest({ url: video.streamingPlaylists[0].segmentsSha256Url, expectedStatus: HttpStatusCode.OK_200 })
+      } catch (err) {
+        // FIXME: try to debug error in CI "Unexpected end of JSON input"
+        console.error(err)
+        throw err
+      }
 
       await wait(100)
     }
@@ -89,6 +95,9 @@ describe('Fast restream in live', function () {
   async function runTest (replay: boolean) {
     const { ffmpegCommand, liveVideoUUID } = await fastRestreamWrapper({ replay })
 
+    // TODO: remove, we try to debug a test timeout failure here
+    console.log('Ensuring last live works')
+
     await ensureLastLiveWorks(liveVideoUUID)
 
     await stopFfmpeg(ffmpegCommand)
@@ -129,8 +138,8 @@ describe('Fast restream in live', function () {
     await server.config.enableLive({ allowReplay: true, transcoding: true, resolutions: 'min' })
   })
 
-  it('Should correctly fast reastream in a permanent live with and without save replay', async function () {
-    this.timeout(240000)
+  it('Should correctly fast restream in a permanent live with and without save replay', async function () {
+    this.timeout(480000)
 
     // A test can take a long time, so prefer to run them in parallel
     await Promise.all([