diff options
-rw-r--r-- | server/controllers/api/videos/comment.ts | 3 | ||||
-rw-r--r-- | server/tests/api/live/live-constraints.ts | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts index 38fa7c3b0..f1f53d354 100644 --- a/server/controllers/api/videos/comment.ts +++ b/server/controllers/api/videos/comment.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
2 | import { ResultList, ThreadsResultList, UserRight } from '../../../../shared/models' | 3 | import { ResultList, ThreadsResultList, UserRight } from '../../../../shared/models' |
3 | import { VideoCommentCreate } from '../../../../shared/models/videos/video-comment.model' | 4 | import { VideoCommentCreate } from '../../../../shared/models/videos/video-comment.model' |
4 | import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' | 5 | import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' |
@@ -29,8 +30,6 @@ import { | |||
29 | } from '../../../middlewares/validators' | 30 | } from '../../../middlewares/validators' |
30 | import { AccountModel } from '../../../models/account/account' | 31 | import { AccountModel } from '../../../models/account/account' |
31 | import { VideoCommentModel } from '../../../models/video/video-comment' | 32 | import { VideoCommentModel } from '../../../models/video/video-comment' |
32 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
33 | import { logger } from '@server/helpers/logger' | ||
34 | 33 | ||
35 | const auditLogger = auditLoggerFactory('comments') | 34 | const auditLogger = auditLoggerFactory('comments') |
36 | const videoCommentRouter = express.Router() | 35 | const videoCommentRouter = express.Router() |
diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts index 1c60a7c76..5569e6066 100644 --- a/server/tests/api/live/live-constraints.ts +++ b/server/tests/api/live/live-constraints.ts | |||
@@ -20,7 +20,8 @@ import { | |||
20 | updateUser, | 20 | updateUser, |
21 | userLogin, | 21 | userLogin, |
22 | wait, | 22 | wait, |
23 | waitJobs | 23 | waitJobs, |
24 | waitUntilLivePublished | ||
24 | } from '../../../../shared/extra-utils' | 25 | } from '../../../../shared/extra-utils' |
25 | 26 | ||
26 | const expect = chai.expect | 27 | const expect = chai.expect |
@@ -55,6 +56,12 @@ describe('Test live constraints', function () { | |||
55 | await checkLiveCleanup(servers[0], videoId, resolutions) | 56 | await checkLiveCleanup(servers[0], videoId, resolutions) |
56 | } | 57 | } |
57 | 58 | ||
59 | async function waitUntilLivePublishedOnAllServers (videoId: string) { | ||
60 | for (const server of servers) { | ||
61 | await waitUntilLivePublished(server.url, server.accessToken, videoId) | ||
62 | } | ||
63 | } | ||
64 | |||
58 | before(async function () { | 65 | before(async function () { |
59 | this.timeout(120000) | 66 | this.timeout(120000) |
60 | 67 | ||
@@ -118,6 +125,7 @@ describe('Test live constraints', function () { | |||
118 | const userVideoLiveoId = await createLiveWrapper(true) | 125 | const userVideoLiveoId = await createLiveWrapper(true) |
119 | await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true) | 126 | await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true) |
120 | 127 | ||
128 | await waitUntilLivePublishedOnAllServers(userVideoLiveoId) | ||
121 | await waitJobs(servers) | 129 | await waitJobs(servers) |
122 | 130 | ||
123 | await checkSaveReplay(userVideoLiveoId) | 131 | await checkSaveReplay(userVideoLiveoId) |
@@ -140,6 +148,7 @@ describe('Test live constraints', function () { | |||
140 | const userVideoLiveoId = await createLiveWrapper(true) | 148 | const userVideoLiveoId = await createLiveWrapper(true) |
141 | await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true) | 149 | await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true) |
142 | 150 | ||
151 | await waitUntilLivePublishedOnAllServers(userVideoLiveoId) | ||
143 | await waitJobs(servers) | 152 | await waitJobs(servers) |
144 | 153 | ||
145 | await checkSaveReplay(userVideoLiveoId) | 154 | await checkSaveReplay(userVideoLiveoId) |
@@ -189,6 +198,7 @@ describe('Test live constraints', function () { | |||
189 | const userVideoLiveoId = await createLiveWrapper(true) | 198 | const userVideoLiveoId = await createLiveWrapper(true) |
190 | await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true) | 199 | await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true) |
191 | 200 | ||
201 | await waitUntilLivePublishedOnAllServers(userVideoLiveoId) | ||
192 | await waitJobs(servers) | 202 | await waitJobs(servers) |
193 | 203 | ||
194 | await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240 ]) | 204 | await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240 ]) |