X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Flive%2Flive-fast-restream.ts;h=2169393c27fc0931caf8229d7726bd0af2e37083;hb=823c34c07fc0df81110098ee1032e9d3ed70b662;hp=c0bb8d529f28f41a3a6b0a085d92f45abf9dc80a;hpb=77239b425a8e00822a53c9907415832a473c3eb6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/live/live-fast-restream.ts b/server/tests/api/live/live-fast-restream.ts index c0bb8d529..2169393c2 100644 --- a/server/tests/api/live/live-fast-restream.ts +++ b/server/tests/api/live/live-fast-restream.ts @@ -2,11 +2,10 @@ import { expect } from 'chai' import { wait } from '@shared/core-utils' -import { HttpStatusCode, LiveVideoCreate, VideoPrivacy } from '@shared/models' +import { LiveVideoCreate, VideoPrivacy } from '@shared/models' import { cleanupTests, createSingleServer, - makeRawRequest, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel, @@ -23,6 +22,7 @@ describe('Fast restream in live', function () { privacy: VideoPrivacy.PUBLIC, name: 'my super live', saveReplay: options.replay, + replaySettings: options.replay ? { privacy: VideoPrivacy.PUBLIC } : undefined, permanentLive: options.permanent } @@ -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({ url: video.streamingPlaylists[0].playlistUrl, expectedStatus: HttpStatusCode.OK_200 }) - await makeRawRequest({ url: video.streamingPlaylists[0].segmentsSha256Url, expectedStatus: HttpStatusCode.OK_200 }) + try { + await server.live.getSegmentFile({ videoUUID: liveId, segment: 0, playlistNumber: 0 }) + await server.streamingPlaylists.get({ url: video.streamingPlaylists[0].playlistUrl }) + await server.streamingPlaylists.getSegmentSha256({ url: video.streamingPlaylists[0].segmentsSha256Url }) + } 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,7 +138,7 @@ 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 () { + 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