X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Flive%2Flive.ts;h=b9caf394d7ab9e84c21e1edf11297da8770d5dba;hb=e69d1ed5cd4cc2b40914af98ffd8d54dff04cc9e;hp=ab7251e312efee4ca6a6cea6cd2c7f82fc49b945;hpb=98ebfa39500ce9dfbb782e43c4d269f9a2989698;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index ab7251e31..b9caf394d 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts @@ -594,6 +594,8 @@ describe('Test live', function () { let permanentLiveReplayName: string + let beforeServerRestart: Date + async function createLiveWrapper (options: { saveReplay: boolean, permanent: boolean }) { const liveAttributes: LiveVideoCreate = { name: 'live video', @@ -608,7 +610,7 @@ describe('Test live', function () { } before(async function () { - this.timeout(160000) + this.timeout(300000) liveVideoId = await createLiveWrapper({ saveReplay: false, permanent: false }) liveVideoReplayId = await createLiveWrapper({ saveReplay: true, permanent: false }) @@ -636,6 +638,8 @@ describe('Test live', function () { } await killallServers([ servers[0] ]) + + beforeServerRestart = new Date() await servers[0].run() await wait(5000) @@ -650,9 +654,13 @@ describe('Test live', function () { }) it('Should save a non permanent live replay', async function () { - this.timeout(120000) + this.timeout(240000) await commands[0].waitUntilPublished({ videoId: liveVideoReplayId }) + + const session = await commands[0].getReplaySession({ videoId: liveVideoReplayId }) + expect(session.endDate).to.exist + expect(new Date(session.endDate)).to.be.above(beforeServerRestart) }) it('Should have saved a permanent live replay', async function () {