]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/multiple-servers.ts
Fix redundancy remove on host redundancy update
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / multiple-servers.ts
index 562079a154d78fddf21f65a77ae9a7bed106bc4d..f9220e4b34a780e2470ed09904fc20414075eda7 100644 (file)
@@ -3,24 +3,24 @@
 import 'mocha'
 import * as chai from 'chai'
 import * as request from 'supertest'
-import { HttpStatusCode } from '@shared/core-utils'
 import {
   buildAbsoluteFixturePath,
   checkTmpIsEmpty,
   checkVideoFilesWereRemoved,
   cleanupTests,
   completeVideoCheck,
+  createMultipleServers,
   dateIsValid,
   doubleFollow,
-  createMultipleServers,
   PeerTubeServer,
+  saveVideoInServers,
   setAccessTokensToServers,
   testImage,
   wait,
   waitJobs,
   webtorrentAdd
 } from '@shared/extra-utils'
-import { VideoCommentThreadTree, VideoPrivacy } from '@shared/models'
+import { HttpStatusCode, VideoCommentThreadTree, VideoPrivacy } from '@shared/models'
 
 const expect = chai.expect
 
@@ -662,19 +662,19 @@ describe('Test multiple servers', function () {
       }
     })
 
-    it('Should remove the videos 3 and 3-2 by asking server 3', async function () {
-      this.timeout(10000)
+    it('Should remove the videos 3 and 3-2 by asking server 3 and correctly delete files', async function () {
+      this.timeout(30000)
 
-      await servers[2].videos.remove({ id: toRemove[0].id })
-      await servers[2].videos.remove({ id: toRemove[1].id })
+      for (const id of [ toRemove[0].id, toRemove[1].id ]) {
+        await saveVideoInServers(servers, id)
 
-      await waitJobs(servers)
-    })
+        await servers[2].videos.remove({ id })
 
-    it('Should not have files of videos 3 and 3-2 on each server', async function () {
-      for (const server of servers) {
-        await checkVideoFilesWereRemoved(toRemove[0].uuid, server)
-        await checkVideoFilesWereRemoved(toRemove[1].uuid, server)
+        await waitJobs(servers)
+
+        for (const server of servers) {
+          await checkVideoFilesWereRemoved({ server, video: server.store.videoDetails })
+        }
       }
     })