]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live.ts
Increase test timeout
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live.ts
index ab7251e312efee4ca6a6cea6cd2c7f82fc49b945..b9caf394d7ab9e84c21e1edf11297da8770d5dba 100644 (file)
@@ -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 () {