aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/live/live-constraints.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/live/live-constraints.ts')
-rw-r--r--server/tests/api/live/live-constraints.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts
index 168241b79..7af6af193 100644
--- a/server/tests/api/live/live-constraints.ts
+++ b/server/tests/api/live/live-constraints.ts
@@ -2,7 +2,7 @@
2 2
3import { expect } from 'chai' 3import { expect } from 'chai'
4import { wait } from '@shared/core-utils' 4import { wait } from '@shared/core-utils'
5import { LiveVideoError, VideoPrivacy } from '@shared/models' 5import { LiveVideoError, UserVideoQuota, VideoPrivacy } from '@shared/models'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 ConfigCommand, 8 ConfigCommand,
@@ -172,12 +172,18 @@ describe('Test live constraints', function () {
172 const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ token: userAccessToken, videoId: userVideoLiveoId }) 172 const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ token: userAccessToken, videoId: userVideoLiveoId })
173 173
174 await servers[0].live.waitUntilPublished({ videoId: userVideoLiveoId }) 174 await servers[0].live.waitUntilPublished({ videoId: userVideoLiveoId })
175 // Wait previous live cleanups
176 await wait(3000)
175 177
176 const baseQuota = await servers[0].users.getMyQuotaUsed({ token: userAccessToken }) 178 const baseQuota = await servers[0].users.getMyQuotaUsed({ token: userAccessToken })
177 179
178 await wait(3000) 180 let quotaUser: UserVideoQuota
181
182 do {
183 await wait(500)
179 184
180 const quotaUser = await servers[0].users.getMyQuotaUsed({ token: userAccessToken }) 185 quotaUser = await servers[0].users.getMyQuotaUsed({ token: userAccessToken })
186 } while (quotaUser.videoQuotaUsed < baseQuota.videoQuotaUsed)
181 187
182 const { data } = await servers[0].users.list() 188 const { data } = await servers[0].users.list()
183 const quotaAdmin = data.find(u => u.username === 'user1') 189 const quotaAdmin = data.find(u => u.username === 'user1')