diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-13 10:06:50 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-13 10:22:53 +0200 |
commit | 3cd0734fd9b0ff21aaef02317a874e8f1c06e027 (patch) | |
tree | 9e8622d269919addd35b462141ab5f22236aa6f4 /server/tests/api/videos/video-channels.ts | |
parent | 2186386cca113506791583cb07d6ccacba7af4e0 (diff) | |
download | PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.tar.gz PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.tar.zst PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.zip |
Improve tests when waiting pending jobs
Diffstat (limited to 'server/tests/api/videos/video-channels.ts')
-rw-r--r-- | server/tests/api/videos/video-channels.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts index 7ae505fd7..ad543e2d6 100644 --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts | |||
@@ -3,7 +3,7 @@ | |||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { User, Video } from '../../../../shared/index' | 5 | import { User, Video } from '../../../../shared/index' |
6 | import { doubleFollow, flushAndRunMultipleServers, getVideoChannelVideos, updateVideo, uploadVideo, wait } from '../../utils' | 6 | import { doubleFollow, flushAndRunMultipleServers, getVideoChannelVideos, updateVideo, uploadVideo } from '../../utils' |
7 | import { | 7 | import { |
8 | addVideoChannel, | 8 | addVideoChannel, |
9 | deleteVideoChannel, | 9 | deleteVideoChannel, |
@@ -17,6 +17,7 @@ import { | |||
17 | setAccessTokensToServers, | 17 | setAccessTokensToServers, |
18 | updateVideoChannel | 18 | updateVideoChannel |
19 | } from '../../utils/index' | 19 | } from '../../utils/index' |
20 | import { waitJobs } from '../../utils/server/jobs' | ||
20 | 21 | ||
21 | const expect = chai.expect | 22 | const expect = chai.expect |
22 | 23 | ||
@@ -49,7 +50,7 @@ describe('Test video channels', function () { | |||
49 | firstVideoChannelUUID = user.videoChannels[0].uuid | 50 | firstVideoChannelUUID = user.videoChannels[0].uuid |
50 | } | 51 | } |
51 | 52 | ||
52 | await wait(5000) | 53 | await waitJobs(servers) |
53 | }) | 54 | }) |
54 | 55 | ||
55 | it('Should have one video channel (created with root)', async () => { | 56 | it('Should have one video channel (created with root)', async () => { |
@@ -80,7 +81,7 @@ describe('Test video channels', function () { | |||
80 | videoUUID = res.body.video.uuid | 81 | videoUUID = res.body.video.uuid |
81 | } | 82 | } |
82 | 83 | ||
83 | await wait(3000) | 84 | await waitJobs(servers) |
84 | }) | 85 | }) |
85 | 86 | ||
86 | it('Should have two video channels when getting my information', async () => { | 87 | it('Should have two video channels when getting my information', async () => { |
@@ -142,7 +143,7 @@ describe('Test video channels', function () { | |||
142 | 143 | ||
143 | await updateVideoChannel(servers[0].url, servers[0].accessToken, secondVideoChannelId, videoChannelAttributes) | 144 | await updateVideoChannel(servers[0].url, servers[0].accessToken, secondVideoChannelId, videoChannelAttributes) |
144 | 145 | ||
145 | await wait(3000) | 146 | await waitJobs(servers) |
146 | }) | 147 | }) |
147 | 148 | ||
148 | it('Should have video channel updated', async function () { | 149 | it('Should have video channel updated', async function () { |
@@ -184,7 +185,7 @@ describe('Test video channels', function () { | |||
184 | 185 | ||
185 | await updateVideo(servers[0].url, servers[0].accessToken, videoUUID, { channelId: firstVideoChannelId }) | 186 | await updateVideo(servers[0].url, servers[0].accessToken, videoUUID, { channelId: firstVideoChannelId }) |
186 | 187 | ||
187 | await wait(5000) | 188 | await waitJobs(servers) |
188 | }) | 189 | }) |
189 | 190 | ||
190 | it('Should list the first video channel videos', async function () { | 191 | it('Should list the first video channel videos', async function () { |
@@ -219,10 +220,5 @@ describe('Test video channels', function () { | |||
219 | 220 | ||
220 | after(async function () { | 221 | after(async function () { |
221 | killallServers(servers) | 222 | killallServers(servers) |
222 | |||
223 | // Keep the logs if the test failed | ||
224 | if (this['ok']) { | ||
225 | await flushTests() | ||
226 | } | ||
227 | }) | 223 | }) |
228 | }) | 224 | }) |