]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/redundancy.ts
Add ability to mute a user/instance by server in client
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / redundancy.ts
index fcf1eacd3c2d2d7b4f789946c365f132751f4f5f..1960854b654136e5d5b40818c7aa5490a40f95a7 100644 (file)
@@ -16,7 +16,8 @@ import {
   uploadVideo,
   viewVideo,
   wait,
-  waitUntilLog
+  waitUntilLog,
+  checkVideoFilesWereRemoved, removeVideo
 } from '../../utils'
 import { waitJobs } from '../../utils/server/jobs'
 import * as magnetUtil from 'magnet-uri'
@@ -242,6 +243,8 @@ describe('Test videos redundancy', function () {
       await wait(5000)
 
       await check1WebSeed(strategy)
+
+      await checkVideoFilesWereRemoved(video1Server2UUID, servers[0].serverNumber, [ 'videos' ])
     })
 
     after(function () {
@@ -287,6 +290,8 @@ describe('Test videos redundancy', function () {
       await wait(5000)
 
       await check1WebSeed(strategy)
+
+      await checkVideoFilesWereRemoved(video1Server2UUID, servers[0].serverNumber, [ 'videos' ])
     })
 
     after(function () {
@@ -344,6 +349,18 @@ describe('Test videos redundancy', function () {
       await checkStatsWith2Webseed(strategy)
     })
 
+    it('Should remove the video and the redundancy files', async function () {
+      this.timeout(20000)
+
+      await removeVideo(servers[1].url, servers[1].accessToken, video1Server2UUID)
+
+      await waitJobs(servers)
+
+      for (const server of servers) {
+        await checkVideoFilesWereRemoved(video1Server2UUID, server.serverNumber)
+      }
+    })
+
     after(function () {
       return cleanServers()
     })
@@ -445,10 +462,17 @@ describe('Test videos redundancy', function () {
         await check1WebSeed(strategy, video1Server2UUID)
         await check2Webseeds(strategy, video2Server2UUID)
       } catch {
-        await wait(7000)
+        await wait(3000)
 
-        await check1WebSeed(strategy, video1Server2UUID)
-        await check2Webseeds(strategy, video2Server2UUID)
+        try {
+          await check1WebSeed(strategy, video1Server2UUID)
+          await check2Webseeds(strategy, video2Server2UUID)
+        } catch {
+          await wait(5000)
+
+          await check1WebSeed(strategy, video1Server2UUID)
+          await check2Webseeds(strategy, video2Server2UUID)
+        }
       }
     })