mirror of https://github.com/Chocobozzz/PeerTube
Fix live constraints tests
parent
39e68a3254
commit
9295c68b74
|
@ -53,7 +53,7 @@ export class GeoIP {
|
||||||
|
|
||||||
await writeFile(mmdbPath, gotResult.body)
|
await writeFile(mmdbPath, gotResult.body)
|
||||||
|
|
||||||
// Reini reader
|
// Reinit reader
|
||||||
this.reader = undefined
|
this.reader = undefined
|
||||||
|
|
||||||
logger.info('GeoIP database updated %s.', mmdbPath, lTags())
|
logger.info('GeoIP database updated %s.', mmdbPath, lTags())
|
||||||
|
|
|
@ -13,6 +13,7 @@ import {
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
setDefaultVideoChannel,
|
setDefaultVideoChannel,
|
||||||
waitJobs,
|
waitJobs,
|
||||||
|
waitUntilLiveReplacedByReplayOnAllServers,
|
||||||
waitUntilLiveWaitingOnAllServers
|
waitUntilLiveWaitingOnAllServers
|
||||||
} from '@shared/server-commands'
|
} from '@shared/server-commands'
|
||||||
import { checkLiveCleanup } from '../../shared'
|
import { checkLiveCleanup } from '../../shared'
|
||||||
|
@ -53,12 +54,6 @@ describe('Test live constraints', function () {
|
||||||
await checkLiveCleanup(servers[0], videoId, resolutions)
|
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 }) {
|
function updateQuota (options: { total: number, daily: number }) {
|
||||||
return servers[0].users.update({
|
return servers[0].users.update({
|
||||||
userId,
|
userId,
|
||||||
|
@ -117,7 +112,7 @@ describe('Test live constraints', function () {
|
||||||
const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false })
|
const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false })
|
||||||
await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
|
await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
|
||||||
|
|
||||||
await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
|
await waitUntilLiveReplacedByReplayOnAllServers(servers, userVideoLiveoId)
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
|
||||||
await checkSaveReplay(userVideoLiveoId)
|
await checkSaveReplay(userVideoLiveoId)
|
||||||
|
@ -153,7 +148,7 @@ describe('Test live constraints', function () {
|
||||||
const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false })
|
const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false })
|
||||||
await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
|
await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
|
||||||
|
|
||||||
await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
|
await waitUntilLiveReplacedByReplayOnAllServers(servers, userVideoLiveoId)
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
|
||||||
await checkSaveReplay(userVideoLiveoId)
|
await checkSaveReplay(userVideoLiveoId)
|
||||||
|
@ -194,7 +189,7 @@ describe('Test live constraints', function () {
|
||||||
const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false })
|
const userVideoLiveoId = await createLiveWrapper({ replay: true, permanent: false })
|
||||||
await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
|
await servers[0].live.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
|
||||||
|
|
||||||
await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
|
await waitUntilLiveReplacedByReplayOnAllServers(servers, userVideoLiveoId)
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
|
||||||
await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240, 144 ])
|
await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240, 144 ])
|
||||||
|
|
Loading…
Reference in New Issue