aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/multiple-servers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/multiple-servers.ts')
-rw-r--r--server/tests/api/multiple-servers.ts33
1 files changed, 17 insertions, 16 deletions
diff --git a/server/tests/api/multiple-servers.ts b/server/tests/api/multiple-servers.ts
index 052b0231f..c80ded862 100644
--- a/server/tests/api/multiple-servers.ts
+++ b/server/tests/api/multiple-servers.ts
@@ -25,6 +25,7 @@ import {
25 doubleFollow 25 doubleFollow
26} from '../utils' 26} from '../utils'
27import { createUser } from '../utils/users' 27import { createUser } from '../utils/users'
28import { viewVideo } from '../utils/videos'
28 29
29const expect = chai.expect 30const expect = chai.expect
30 31
@@ -486,10 +487,10 @@ describe('Test multiple servers', function () {
486 this.timeout(10000) 487 this.timeout(10000)
487 488
488 const tasks: Promise<any>[] = [] 489 const tasks: Promise<any>[] = []
489 tasks.push(getVideo(servers[2].url, localVideosServer3[0])) 490 tasks.push(viewVideo(servers[2].url, localVideosServer3[0]))
490 tasks.push(getVideo(servers[2].url, localVideosServer3[0])) 491 tasks.push(viewVideo(servers[2].url, localVideosServer3[0]))
491 tasks.push(getVideo(servers[2].url, localVideosServer3[0])) 492 tasks.push(viewVideo(servers[2].url, localVideosServer3[0]))
492 tasks.push(getVideo(servers[2].url, localVideosServer3[1])) 493 tasks.push(viewVideo(servers[2].url, localVideosServer3[1]))
493 494
494 await Promise.all(tasks) 495 await Promise.all(tasks)
495 496
@@ -502,8 +503,8 @@ describe('Test multiple servers', function () {
502 const video0 = videos.find(v => v.uuid === localVideosServer3[0]) 503 const video0 = videos.find(v => v.uuid === localVideosServer3[0])
503 const video1 = videos.find(v => v.uuid === localVideosServer3[1]) 504 const video1 = videos.find(v => v.uuid === localVideosServer3[1])
504 505
505 expect(video0.views).to.equal(7) 506 expect(video0.views).to.equal(3)
506 expect(video1.views).to.equal(5) 507 expect(video1.views).to.equal(1)
507 } 508 }
508 }) 509 })
509 510
@@ -511,16 +512,16 @@ describe('Test multiple servers', function () {
511 this.timeout(15000) 512 this.timeout(15000)
512 513
513 const tasks: Promise<any>[] = [] 514 const tasks: Promise<any>[] = []
514 tasks.push(getVideo(servers[0].url, remoteVideosServer1[0])) 515 tasks.push(viewVideo(servers[0].url, remoteVideosServer1[0]))
515 tasks.push(getVideo(servers[1].url, remoteVideosServer2[0])) 516 tasks.push(viewVideo(servers[1].url, remoteVideosServer2[0]))
516 tasks.push(getVideo(servers[1].url, remoteVideosServer2[0])) 517 tasks.push(viewVideo(servers[1].url, remoteVideosServer2[0]))
517 tasks.push(getVideo(servers[2].url, remoteVideosServer3[0])) 518 tasks.push(viewVideo(servers[2].url, remoteVideosServer3[0]))
518 tasks.push(getVideo(servers[2].url, remoteVideosServer3[1])) 519 tasks.push(viewVideo(servers[2].url, remoteVideosServer3[1]))
519 tasks.push(getVideo(servers[2].url, remoteVideosServer3[1])) 520 tasks.push(viewVideo(servers[2].url, remoteVideosServer3[1]))
520 tasks.push(getVideo(servers[2].url, remoteVideosServer3[1])) 521 tasks.push(viewVideo(servers[2].url, remoteVideosServer3[1]))
521 tasks.push(getVideo(servers[2].url, localVideosServer3[1])) 522 tasks.push(viewVideo(servers[2].url, localVideosServer3[1]))
522 tasks.push(getVideo(servers[2].url, localVideosServer3[1])) 523 tasks.push(viewVideo(servers[2].url, localVideosServer3[1]))
523 tasks.push(getVideo(servers[2].url, localVideosServer3[1])) 524 tasks.push(viewVideo(servers[2].url, localVideosServer3[1]))
524 525
525 await Promise.all(tasks) 526 await Promise.all(tasks)
526 527