aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
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
parent34caef7fc0710623c6894549423813d53f65b303 (diff)
downloadPeerTube-59fd824cf3434a8417b73230f1840fed327e3495.tar.gz
PeerTube-59fd824cf3434a8417b73230f1840fed327e3495.tar.zst
PeerTube-59fd824cf3434a8417b73230f1840fed327e3495.zip
Fix tests timeout
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/check-params/live.ts4
-rw-r--r--server/tests/api/check-params/video-captions.ts7
-rw-r--r--server/tests/api/live/live-permanent.ts6
-rw-r--r--server/tests/api/live/live-save-replay.ts4
-rw-r--r--server/tests/api/notifications/moderation-notifications.ts6
-rw-r--r--server/tests/api/notifications/user-notifications.ts24
-rw-r--r--server/tests/api/users/users-verification.ts3
-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
-rw-r--r--server/tests/plugins/plugin-helpers.ts2
11 files changed, 49 insertions, 49 deletions
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts
index 7e76caf6e..a5493572b 100644
--- a/server/tests/api/check-params/live.ts
+++ b/server/tests/api/check-params/live.ts
@@ -402,7 +402,7 @@ describe('Test video lives API validator', function () {
402 }) 402 })
403 403
404 it('Should fail to update a live if it has already started', async function () { 404 it('Should fail to update a live if it has already started', async function () {
405 this.timeout(20000) 405 this.timeout(40000)
406 406
407 const resLive = await getLive(server.url, server.accessToken, videoId) 407 const resLive = await getLive(server.url, server.accessToken, videoId)
408 const live: LiveVideo = resLive.body 408 const live: LiveVideo = resLive.body
@@ -416,7 +416,7 @@ describe('Test video lives API validator', function () {
416 }) 416 })
417 417
418 it('Should fail to stream twice in the save live', async function () { 418 it('Should fail to stream twice in the save live', async function () {
419 this.timeout(30000) 419 this.timeout(40000)
420 420
421 const resLive = await getLive(server.url, server.accessToken, videoId) 421 const resLive = await getLive(server.url, server.accessToken, videoId)
422 const live: LiveVideo = resLive.body 422 const live: LiveVideo = resLive.body
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts
index e42e8db81..2f049c03d 100644
--- a/server/tests/api/check-params/video-captions.ts
+++ b/server/tests/api/check-params/video-captions.ts
@@ -58,7 +58,7 @@ describe('Test video captions API validator', function () {
58 await makeUploadRequest({ 58 await makeUploadRequest({
59 method: 'PUT', 59 method: 'PUT',
60 url: server.url, 60 url: server.url,
61 path: path + '4da6fde3-88f7-4d16-b119-108df563d0b06/captions', 61 path: path + '4da6fde3-88f7-4d16-b119-108df563d0b06/captions/fr',
62 token: server.accessToken, 62 token: server.accessToken,
63 fields, 63 fields,
64 attaches 64 attaches
@@ -69,10 +69,11 @@ describe('Test video captions API validator', function () {
69 await makeUploadRequest({ 69 await makeUploadRequest({
70 method: 'PUT', 70 method: 'PUT',
71 url: server.url, 71 url: server.url,
72 path: path + '4da6fde3-88f7-4d16-b119-108df5630b06/captions', 72 path: path + '4da6fde3-88f7-4d16-b119-108df5630b06/captions/fr',
73 token: server.accessToken, 73 token: server.accessToken,
74 fields, 74 fields,
75 attaches 75 attaches,
76 statusCodeExpected: 404
76 }) 77 })
77 }) 78 })
78 79
diff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.ts
index 2701c65e3..9e6c6cf70 100644
--- a/server/tests/api/live/live-permanent.ts
+++ b/server/tests/api/live/live-permanent.ts
@@ -20,7 +20,8 @@ import {
20 updateLive, 20 updateLive,
21 wait, 21 wait,
22 waitJobs, 22 waitJobs,
23 waitUntilLivePublished 23 waitUntilLivePublished,
24 waitUntilLiveWaiting
24} from '../../../../shared/extra-utils' 25} from '../../../../shared/extra-utils'
25 26
26const expect = chai.expect 27const expect = chai.expect
@@ -111,7 +112,7 @@ describe('Permenant live', function () {
111 }) 112 })
112 113
113 it('Should stream into this permanent live', async function () { 114 it('Should stream into this permanent live', async function () {
114 this.timeout(40000) 115 this.timeout(60000)
115 116
116 const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, videoUUID) 117 const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, videoUUID)
117 118
@@ -122,6 +123,7 @@ describe('Permenant live', function () {
122 await checkVideoState(videoUUID, VideoState.PUBLISHED) 123 await checkVideoState(videoUUID, VideoState.PUBLISHED)
123 124
124 await stopFfmpeg(command) 125 await stopFfmpeg(command)
126 await waitUntilLiveWaiting(servers[0].url, servers[0].accessToken, videoUUID)
125 127
126 await waitJobs(servers) 128 await waitJobs(servers)
127 }) 129 })
diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts
index bd683b2bf..6cd8cc23f 100644
--- a/server/tests/api/live/live-save-replay.ts
+++ b/server/tests/api/live/live-save-replay.ts
@@ -136,7 +136,7 @@ describe('Save replay setting', function () {
136 }) 136 })
137 137
138 it('Should correctly delete the video files after the stream ended', async function () { 138 it('Should correctly delete the video files after the stream ended', async function () {
139 this.timeout(30000) 139 this.timeout(40000)
140 140
141 await stopFfmpeg(ffmpegCommand) 141 await stopFfmpeg(ffmpegCommand)
142 142
@@ -146,6 +146,8 @@ describe('Save replay setting', function () {
146 await checkVideosExist(liveVideoUUID, false, HttpStatusCode.OK_200) 146 await checkVideosExist(liveVideoUUID, false, HttpStatusCode.OK_200)
147 await checkVideoState(liveVideoUUID, VideoState.LIVE_ENDED) 147 await checkVideoState(liveVideoUUID, VideoState.LIVE_ENDED)
148 148
149 await waitJobs(servers)
150
149 // No resolutions saved since we did not save replay 151 // No resolutions saved since we did not save replay
150 await checkLiveCleanup(servers[0], liveVideoUUID, []) 152 await checkLiveCleanup(servers[0], liveVideoUUID, [])
151 }) 153 })
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts
index 24c91a365..81f02ff99 100644
--- a/server/tests/api/notifications/moderation-notifications.ts
+++ b/server/tests/api/notifications/moderation-notifications.ts
@@ -546,7 +546,7 @@ describe('Test moderation notifications', function () {
546 }) 546 })
547 547
548 it('Should send unblacklist but not published/subscription notes after unblacklisted if scheduled update pending', async function () { 548 it('Should send unblacklist but not published/subscription notes after unblacklisted if scheduled update pending', async function () {
549 this.timeout(20000) 549 this.timeout(40000)
550 550
551 const updateAt = new Date(new Date().getTime() + 1000000) 551 const updateAt = new Date(new Date().getTime() + 1000000)
552 552
@@ -578,7 +578,7 @@ describe('Test moderation notifications', function () {
578 }) 578 })
579 579
580 it('Should not send publish/subscription notifications after scheduled update if video still auto-blacklisted', async function () { 580 it('Should not send publish/subscription notifications after scheduled update if video still auto-blacklisted', async function () {
581 this.timeout(20000) 581 this.timeout(40000)
582 582
583 // In 2 seconds 583 // In 2 seconds
584 const updateAt = new Date(new Date().getTime() + 2000) 584 const updateAt = new Date(new Date().getTime() + 2000)
@@ -604,7 +604,7 @@ describe('Test moderation notifications', function () {
604 }) 604 })
605 605
606 it('Should not send a notification to moderators on new video without auto-blacklist', async function () { 606 it('Should not send a notification to moderators on new video without auto-blacklist', async function () {
607 this.timeout(20000) 607 this.timeout(40000)
608 608
609 const name = 'video without auto-blacklist ' + uuidv4() 609 const name = 'video without auto-blacklist ' + uuidv4()
610 610
diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts
index edc95b069..6e7e7b19f 100644
--- a/server/tests/api/notifications/user-notifications.ts
+++ b/server/tests/api/notifications/user-notifications.ts
@@ -65,7 +65,7 @@ describe('Test user notifications', function () {
65 }) 65 })
66 66
67 it('Should not send notifications if the user does not follow the video publisher', async function () { 67 it('Should not send notifications if the user does not follow the video publisher', async function () {
68 this.timeout(30000) 68 this.timeout(50000)
69 69
70 await uploadRandomVideoOnServers(servers, 1) 70 await uploadRandomVideoOnServers(servers, 1)
71 71
@@ -97,7 +97,7 @@ describe('Test user notifications', function () {
97 }) 97 })
98 98
99 it('Should send a new video notification on a scheduled publication', async function () { 99 it('Should send a new video notification on a scheduled publication', async function () {
100 this.timeout(30000) 100 this.timeout(50000)
101 101
102 // In 2 seconds 102 // In 2 seconds
103 const updateAt = new Date(new Date().getTime() + 2000) 103 const updateAt = new Date(new Date().getTime() + 2000)
@@ -136,7 +136,7 @@ describe('Test user notifications', function () {
136 }) 136 })
137 137
138 it('Should not send a notification before the video is published', async function () { 138 it('Should not send a notification before the video is published', async function () {
139 this.timeout(30000) 139 this.timeout(50000)
140 140
141 const updateAt = new Date(new Date().getTime() + 1000000) 141 const updateAt = new Date(new Date().getTime() + 1000000)
142 142
@@ -154,7 +154,7 @@ describe('Test user notifications', function () {
154 }) 154 })
155 155
156 it('Should send a new video notification when a video becomes public', async function () { 156 it('Should send a new video notification when a video becomes public', async function () {
157 this.timeout(30000) 157 this.timeout(50000)
158 158
159 const data = { privacy: VideoPrivacy.PRIVATE } 159 const data = { privacy: VideoPrivacy.PRIVATE }
160 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data) 160 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data)
@@ -168,7 +168,7 @@ describe('Test user notifications', function () {
168 }) 168 })
169 169
170 it('Should send a new video notification when a remote video becomes public', async function () { 170 it('Should send a new video notification when a remote video becomes public', async function () {
171 this.timeout(30000) 171 this.timeout(50000)
172 172
173 const data = { privacy: VideoPrivacy.PRIVATE } 173 const data = { privacy: VideoPrivacy.PRIVATE }
174 const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data) 174 const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data)
@@ -182,7 +182,7 @@ describe('Test user notifications', function () {
182 }) 182 })
183 183
184 it('Should not send a new video notification when a video becomes unlisted', async function () { 184 it('Should not send a new video notification when a video becomes unlisted', async function () {
185 this.timeout(30000) 185 this.timeout(50000)
186 186
187 const data = { privacy: VideoPrivacy.PRIVATE } 187 const data = { privacy: VideoPrivacy.PRIVATE }
188 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data) 188 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data)
@@ -193,7 +193,7 @@ describe('Test user notifications', function () {
193 }) 193 })
194 194
195 it('Should not send a new video notification when a remote video becomes unlisted', async function () { 195 it('Should not send a new video notification when a remote video becomes unlisted', async function () {
196 this.timeout(30000) 196 this.timeout(50000)
197 197
198 const data = { privacy: VideoPrivacy.PRIVATE } 198 const data = { privacy: VideoPrivacy.PRIVATE }
199 const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data) 199 const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data)
@@ -237,7 +237,7 @@ describe('Test user notifications', function () {
237 }) 237 })
238 238
239 it('Should not send a notification if transcoding is not enabled', async function () { 239 it('Should not send a notification if transcoding is not enabled', async function () {
240 this.timeout(30000) 240 this.timeout(50000)
241 241
242 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1) 242 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1)
243 await waitJobs(servers) 243 await waitJobs(servers)
@@ -416,7 +416,7 @@ describe('Test user notifications', function () {
416 }) 416 })
417 417
418 it('Should notify when a local channel is following one of our channel', async function () { 418 it('Should notify when a local channel is following one of our channel', async function () {
419 this.timeout(30000) 419 this.timeout(50000)
420 420
421 await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1_channel@localhost:' + servers[0].port) 421 await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1_channel@localhost:' + servers[0].port)
422 await waitJobs(servers) 422 await waitJobs(servers)
@@ -427,7 +427,7 @@ describe('Test user notifications', function () {
427 }) 427 })
428 428
429 it('Should notify when a remote channel is following one of our channel', async function () { 429 it('Should notify when a remote channel is following one of our channel', async function () {
430 this.timeout(30000) 430 this.timeout(50000)
431 431
432 await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1_channel@localhost:' + servers[0].port) 432 await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1_channel@localhost:' + servers[0].port)
433 await waitJobs(servers) 433 await waitJobs(servers)
@@ -439,7 +439,7 @@ describe('Test user notifications', function () {
439 439
440 // PeerTube does not support accout -> account follows 440 // PeerTube does not support accout -> account follows
441 // it('Should notify when a local account is following one of our channel', async function () { 441 // it('Should notify when a local account is following one of our channel', async function () {
442 // this.timeout(30000) 442 // this.timeout(50000)
443 // 443 //
444 // await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1@localhost:' + servers[0].port) 444 // await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1@localhost:' + servers[0].port)
445 // 445 //
@@ -449,7 +449,7 @@ describe('Test user notifications', function () {
449 // }) 449 // })
450 450
451 // it('Should notify when a remote account is following one of our channel', async function () { 451 // it('Should notify when a remote account is following one of our channel', async function () {
452 // this.timeout(30000) 452 // this.timeout(50000)
453 // 453 //
454 // await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1@localhost:' + servers[0].port) 454 // await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1@localhost:' + servers[0].port)
455 // 455 //
diff --git a/server/tests/api/users/users-verification.ts b/server/tests/api/users/users-verification.ts
index 675ebf690..e05acdd72 100644
--- a/server/tests/api/users/users-verification.ts
+++ b/server/tests/api/users/users-verification.ts
@@ -55,7 +55,8 @@ describe('Test users account verification', function () {
55 }) 55 })
56 56
57 it('Should register user and send verification email if verification required', async function () { 57 it('Should register user and send verification email if verification required', async function () {
58 this.timeout(5000) 58 this.timeout(30000)
59
59 await updateCustomSubConfig(server.url, server.accessToken, { 60 await updateCustomSubConfig(server.url, server.accessToken, {
60 signup: { 61 signup: {
61 enabled: true, 62 enabled: true,
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)
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts
index c0d95e1e0..a585e3020 100644
--- a/server/tests/plugins/plugin-helpers.ts
+++ b/server/tests/plugins/plugin-helpers.ts
@@ -180,7 +180,7 @@ describe('Test plugin helpers', function () {
180 }) 180 })
181 181
182 it('Should remove a video after a view', async function () { 182 it('Should remove a video after a view', async function () {
183 this.timeout(20000) 183 this.timeout(40000)
184 184
185 // Should not throw -> video exists 185 // Should not throw -> video exists
186 await getVideo(servers[0].url, videoUUID) 186 await getVideo(servers[0].url, videoUUID)