diff options
author | Chocobozzz <me@florianbigard.com> | 2022-05-03 16:12:10 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-05-03 16:12:10 +0200 |
commit | 9295c68b74fe1f1e2e9f72009205d7f0379844c5 (patch) | |
tree | 28172f50c4b3e5fe63a233e3e4a7c27ac3d307da /server/tests | |
parent | 39e68a3254242bd410ffc20b7f74b442a07b390f (diff) | |
download | PeerTube-9295c68b74fe1f1e2e9f72009205d7f0379844c5.tar.gz PeerTube-9295c68b74fe1f1e2e9f72009205d7f0379844c5.tar.zst PeerTube-9295c68b74fe1f1e2e9f72009205d7f0379844c5.zip |
Fix live constraints tests
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/live/live-constraints.ts | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts index b81973395..cab76f425 100644 --- a/server/tests/api/live/live-constraints.ts +++ b/server/tests/api/live/live-constraints.ts | |||
@@ -13,6 +13,7 @@ import { | |||
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | setDefaultVideoChannel, | 14 | setDefaultVideoChannel, |
15 | waitJobs, | 15 | waitJobs, |
16 | waitUntilLiveReplacedByReplayOnAllServers, | ||
16 | waitUntilLiveWaitingOnAllServers | 17 | waitUntilLiveWaitingOnAllServers |
17 | } from '@shared/server-commands' | 18 | } from '@shared/server-commands' |
18 | import { checkLiveCleanup } from '../../shared' | 19 | import { checkLiveCleanup } from '../../shared' |
@@ -53,12 +54,6 @@ describe('Test live constraints', function () { | |||
53 | await checkLiveCleanup(servers[0], videoId, resolutions) | 54 | await checkLiveCleanup(servers[0], videoId, resolutions) |
54 | } | 55 | } |
55 | 56 | ||
56 | async function waitUntilLivePublishedOnAllServers (videoId: string) { | ||
57 | for (const server of servers) { | ||
58 | await server.live.waitUntilPublished({ videoId }) | ||
59 | } | ||
60 | } | ||
61 | |||
62 | function updateQuota (options: { total: number, daily: number }) { | 57 | function updateQuota (options: { total: number, daily: number }) { |
63 | return servers[0].users.update({ | 58 | return servers[0].users.update({ |
64 | userId, | 59 | userId, |
@@ -117,7 +112,7 @@ describe('Test live constraints', function () { | |||
117 | const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false }) | 112 | const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false }) |
118 | await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) | 113 | await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) |
119 | 114 | ||
120 | await waitUntilLivePublishedOnAllServers(userVideoLiveoId) | 115 | await waitUntilLiveReplacedByReplayOnAllServers(servers, userVideoLiveoId) |
121 | await waitJobs(servers) | 116 | await waitJobs(servers) |
122 | 117 | ||
123 | await checkSaveReplay(userVideoLiveoId) | 118 | await checkSaveReplay(userVideoLiveoId) |
@@ -153,7 +148,7 @@ describe('Test live constraints', function () { | |||
153 | const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false }) | 148 | const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false }) |
154 | await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) | 149 | await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) |
155 | 150 | ||
156 | await waitUntilLivePublishedOnAllServers(userVideoLiveoId) | 151 | await waitUntilLiveReplacedByReplayOnAllServers(servers, userVideoLiveoId) |
157 | await waitJobs(servers) | 152 | await waitJobs(servers) |
158 | 153 | ||
159 | await checkSaveReplay(userVideoLiveoId) | 154 | await checkSaveReplay(userVideoLiveoId) |
@@ -194,7 +189,7 @@ describe('Test live constraints', function () { | |||
194 | const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false }) | 189 | const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false }) |
195 | await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) | 190 | await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) |
196 | 191 | ||
197 | await waitUntilLivePublishedOnAllServers(userVideoLiveoId) | 192 | await waitUntilLiveReplacedByReplayOnAllServers(servers, userVideoLiveoId) |
198 | await waitJobs(servers) | 193 | await waitJobs(servers) |
199 | 194 | ||
200 | await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240, 144 ]) | 195 | await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240, 144 ]) |