From 9295c68b74fe1f1e2e9f72009205d7f0379844c5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 3 May 2022 16:12:10 +0200 Subject: Fix live constraints tests --- server/tests/api/live/live-constraints.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'server/tests/api/live') 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 { setAccessTokensToServers, setDefaultVideoChannel, waitJobs, + waitUntilLiveReplacedByReplayOnAllServers, waitUntilLiveWaitingOnAllServers } from '@shared/server-commands' import { checkLiveCleanup } from '../../shared' @@ -53,12 +54,6 @@ describe('Test live constraints', function () { await checkLiveCleanup(servers[0], videoId, resolutions) } - async function waitUntilLivePublishedOnAllServers (videoId: string) { - for (const server of servers) { - await server.live.waitUntilPublished({ videoId }) - } - } - function updateQuota (options: { total: number, daily: number }) { return servers[0].users.update({ userId, @@ -117,7 +112,7 @@ describe('Test live constraints', function () { const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false }) await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) - await waitUntilLivePublishedOnAllServers(userVideoLiveoId) + await waitUntilLiveReplacedByReplayOnAllServers(servers, userVideoLiveoId) await waitJobs(servers) await checkSaveReplay(userVideoLiveoId) @@ -153,7 +148,7 @@ describe('Test live constraints', function () { const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false }) await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) - await waitUntilLivePublishedOnAllServers(userVideoLiveoId) + await waitUntilLiveReplacedByReplayOnAllServers(servers, userVideoLiveoId) await waitJobs(servers) await checkSaveReplay(userVideoLiveoId) @@ -194,7 +189,7 @@ describe('Test live constraints', function () { const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false }) await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true }) - await waitUntilLivePublishedOnAllServers(userVideoLiveoId) + await waitUntilLiveReplacedByReplayOnAllServers(servers, userVideoLiveoId) await waitJobs(servers) await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240, 144 ]) -- cgit v1.2.3