aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/redundancy/redundancy.ts31
1 files changed, 22 insertions, 9 deletions
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts
index 3400b1d9a..fe42e5fa8 100644
--- a/server/tests/api/redundancy/redundancy.ts
+++ b/server/tests/api/redundancy/redundancy.ts
@@ -49,7 +49,7 @@ async function checkMagnetWebseeds (file: VideoFile, baseWebseeds: string[], ser
49 } 49 }
50} 50}
51 51
52async function createSingleServers (strategy: VideoRedundancyStrategy | null, additionalParams: any = {}, withWebtorrent = true) { 52async function createServers (strategy: VideoRedundancyStrategy | null, additionalParams: any = {}, withWebtorrent = true) {
53 const strategies: any[] = [] 53 const strategies: any[] = []
54 54
55 if (strategy !== null) { 55 if (strategy !== null) {
@@ -309,7 +309,7 @@ describe('Test videos redundancy', function () {
309 before(function () { 309 before(function () {
310 this.timeout(120000) 310 this.timeout(120000)
311 311
312 return createSingleServers(strategy) 312 return createServers(strategy)
313 }) 313 })
314 314
315 it('Should have 1 webseed on the first video', async function () { 315 it('Should have 1 webseed on the first video', async function () {
@@ -359,7 +359,7 @@ describe('Test videos redundancy', function () {
359 before(function () { 359 before(function () {
360 this.timeout(120000) 360 this.timeout(120000)
361 361
362 return createSingleServers(strategy) 362 return createServers(strategy)
363 }) 363 })
364 364
365 it('Should have 1 webseed on the first video', async function () { 365 it('Should have 1 webseed on the first video', async function () {
@@ -384,7 +384,20 @@ describe('Test videos redundancy', function () {
384 await checkStatsWith1Redundancy(strategy) 384 await checkStatsWith1Redundancy(strategy)
385 }) 385 })
386 386
387 it('Should unfollow on server 1 and remove duplicated videos', async function () { 387 it('Should unfollow server 3 and keep duplicated videos', async function () {
388 this.timeout(80000)
389
390 await servers[0].follows.unfollow({ target: servers[2] })
391
392 await waitJobs(servers)
393 await wait(5000)
394
395 await check2Webseeds()
396 await check1PlaylistRedundancies()
397 await checkStatsWith1Redundancy(strategy)
398 })
399
400 it('Should unfollow server 2 and remove duplicated videos', async function () {
388 this.timeout(80000) 401 this.timeout(80000)
389 402
390 await servers[0].follows.unfollow({ target: servers[1] }) 403 await servers[0].follows.unfollow({ target: servers[1] })
@@ -409,7 +422,7 @@ describe('Test videos redundancy', function () {
409 before(function () { 422 before(function () {
410 this.timeout(120000) 423 this.timeout(120000)
411 424
412 return createSingleServers(strategy, { min_views: 3 }) 425 return createServers(strategy, { min_views: 3 })
413 }) 426 })
414 427
415 it('Should have 1 webseed on the first video', async function () { 428 it('Should have 1 webseed on the first video', async function () {
@@ -480,7 +493,7 @@ describe('Test videos redundancy', function () {
480 before(async function () { 493 before(async function () {
481 this.timeout(120000) 494 this.timeout(120000)
482 495
483 await createSingleServers(strategy, { min_views: 3 }, false) 496 await createServers(strategy, { min_views: 3 }, false)
484 }) 497 })
485 498
486 it('Should have 0 playlist redundancy on the first video', async function () { 499 it('Should have 0 playlist redundancy on the first video', async function () {
@@ -542,7 +555,7 @@ describe('Test videos redundancy', function () {
542 before(function () { 555 before(function () {
543 this.timeout(120000) 556 this.timeout(120000)
544 557
545 return createSingleServers(null) 558 return createServers(null)
546 }) 559 })
547 560
548 it('Should have 1 webseed on the first video', async function () { 561 it('Should have 1 webseed on the first video', async function () {
@@ -621,7 +634,7 @@ describe('Test videos redundancy', function () {
621 before(async function () { 634 before(async function () {
622 this.timeout(120000) 635 this.timeout(120000)
623 636
624 await createSingleServers(strategy, { min_lifetime: '7 seconds', min_views: 0 }) 637 await createServers(strategy, { min_lifetime: '7 seconds', min_views: 0 })
625 638
626 await enableRedundancyOnServer1() 639 await enableRedundancyOnServer1()
627 }) 640 })
@@ -663,7 +676,7 @@ describe('Test videos redundancy', function () {
663 before(async function () { 676 before(async function () {
664 this.timeout(120000) 677 this.timeout(120000)
665 678
666 await createSingleServers(strategy, { min_lifetime: '7 seconds', min_views: 0 }) 679 await createServers(strategy, { min_lifetime: '7 seconds', min_views: 0 })
667 680
668 await enableRedundancyOnServer1() 681 await enableRedundancyOnServer1()
669 682