aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-11 10:36:05 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-14 09:11:27 +0100
commit59fd824cf3434a8417b73230f1840fed327e3495 (patch)
treeb3c25022099adf2a41ed8da5328c4147d60add83 /server/tests/api/videos
parent34caef7fc0710623c6894549423813d53f65b303 (diff)
downloadPeerTube-59fd824cf3434a8417b73230f1840fed327e3495.tar.gz
PeerTube-59fd824cf3434a8417b73230f1840fed327e3495.tar.zst
PeerTube-59fd824cf3434a8417b73230f1840fed327e3495.zip
Fix tests timeout
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/video-captions.ts2
-rw-r--r--server/tests/api/videos/video-playlists.ts38
-rw-r--r--server/tests/api/videos/videos-views-cleaner.ts2
3 files changed, 18 insertions, 24 deletions
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts
index 00e04d69d..5b36dc021 100644
--- a/server/tests/api/videos/video-captions.ts
+++ b/server/tests/api/videos/video-captions.ts
@@ -28,7 +28,7 @@ describe('Test video captions', function () {
28 let videoUUID: string 28 let videoUUID: string
29 29
30 before(async function () { 30 before(async function () {
31 this.timeout(30000) 31 this.timeout(60000)
32 32
33 servers = await flushAndRunMultipleServers(2) 33 servers = await flushAndRunMultipleServers(2)
34 34
diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts
index 0a96ea9a0..9dad58c8c 100644
--- a/server/tests/api/videos/video-playlists.ts
+++ b/server/tests/api/videos/video-playlists.ts
@@ -1,7 +1,8 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai'
4import 'mocha' 3import 'mocha'
4import * as chai from 'chai'
5import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
5import { 6import {
6 addVideoChannel, 7 addVideoChannel,
7 addVideoInPlaylist, 8 addVideoInPlaylist,
@@ -44,13 +45,6 @@ import {
44 wait, 45 wait,
45 waitJobs 46 waitJobs
46} from '../../../../shared/extra-utils' 47} from '../../../../shared/extra-utils'
47import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model'
48import { VideoPlaylist } from '../../../../shared/models/videos/playlist/video-playlist.model'
49import { VideoPrivacy } from '../../../../shared/models/videos'
50import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model'
51import { VideoExistInPlaylist } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model'
52import { User } from '../../../../shared/models/users'
53import { VideoPlaylistElement, VideoPlaylistElementType } from '../../../../shared/models/videos/playlist/video-playlist-element.model'
54import { 48import {
55 addAccountToAccountBlocklist, 49 addAccountToAccountBlocklist,
56 addAccountToServerBlocklist, 50 addAccountToServerBlocklist,
@@ -61,7 +55,13 @@ import {
61 removeServerFromAccountBlocklist, 55 removeServerFromAccountBlocklist,
62 removeServerFromServerBlocklist 56 removeServerFromServerBlocklist
63} from '../../../../shared/extra-utils/users/blocklist' 57} from '../../../../shared/extra-utils/users/blocklist'
64import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 58import { User } from '../../../../shared/models/users'
59import { VideoPrivacy } from '../../../../shared/models/videos'
60import { VideoExistInPlaylist } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model'
61import { VideoPlaylistElement, VideoPlaylistElementType } from '../../../../shared/models/videos/playlist/video-playlist-element.model'
62import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model'
63import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model'
64import { VideoPlaylist } from '../../../../shared/models/videos/playlist/video-playlist.model'
65 65
66const expect = chai.expect 66const expect = chai.expect
67 67
@@ -123,24 +123,18 @@ describe('Test video playlists', function () {
123 await doubleFollow(servers[0], servers[2]) 123 await doubleFollow(servers[0], servers[2])
124 124
125 { 125 {
126 const serverPromises: Promise<any>[][] = [] 126 servers[0].videos = []
127 servers[1].videos = []
128 servers[2].videos = []
127 129
128 for (const server of servers) { 130 for (const server of servers) {
129 const videoPromises: Promise<any>[] = []
130
131 for (let i = 0; i < 7; i++) { 131 for (let i = 0; i < 7; i++) {
132 videoPromises.push( 132 const name = `video ${i} server ${server.serverNumber}`
133 uploadVideo(server.url, server.accessToken, { name: `video ${i} server ${server.serverNumber}`, nsfw: false }) 133 const resVideo = await uploadVideo(server.url, server.accessToken, { name, nsfw: false })
134 .then(res => res.body.video)
135 )
136 }
137 134
138 serverPromises.push(videoPromises) 135 server.videos.push(resVideo.body.video)
136 }
139 } 137 }
140
141 servers[0].videos = await Promise.all(serverPromises[0])
142 servers[1].videos = await Promise.all(serverPromises[1])
143 servers[2].videos = await Promise.all(serverPromises[2])
144 } 138 }
145 139
146 nsfwVideoServer1 = (await uploadVideoAndGetId({ server: servers[0], videoName: 'NSFW video', nsfw: true })).id 140 nsfwVideoServer1 = (await uploadVideoAndGetId({ server: servers[0], videoName: 'NSFW video', nsfw: true })).id
diff --git a/server/tests/api/videos/videos-views-cleaner.ts b/server/tests/api/videos/videos-views-cleaner.ts
index c5b28540c..b89f33217 100644
--- a/server/tests/api/videos/videos-views-cleaner.ts
+++ b/server/tests/api/videos/videos-views-cleaner.ts
@@ -27,7 +27,7 @@ describe('Test video views cleaner', function () {
27 let videoIdServer2: string 27 let videoIdServer2: string
28 28
29 before(async function () { 29 before(async function () {
30 this.timeout(50000) 30 this.timeout(120000)
31 31
32 servers = await flushAndRunMultipleServers(2) 32 servers = await flushAndRunMultipleServers(2)
33 await setAccessTokensToServers(servers) 33 await setAccessTokensToServers(servers)