mirror of https://github.com/Chocobozzz/PeerTube
Fix proxy tests
parent
3fc43fa0b0
commit
e82cb08722
|
@ -323,7 +323,7 @@ describe('Object storage for videos', function () {
|
|||
|
||||
const { uuid } = await server.videos.quickUpload({ name: 'video' })
|
||||
|
||||
await waitJobs([ server ], true)
|
||||
await waitJobs([ server ], { skipDelayed: true })
|
||||
const video = await server.videos.get({ id: uuid })
|
||||
|
||||
expectStartWith(video.files[0].fileUrl, server.url)
|
||||
|
@ -358,7 +358,7 @@ describe('Object storage for videos', function () {
|
|||
|
||||
const { uuid } = await server.videos.quickUpload({ name: 'video' })
|
||||
|
||||
await waitJobs([ server ], true)
|
||||
await waitJobs([ server ], { skipDelayed: true })
|
||||
const video = await server.videos.get({ id: uuid })
|
||||
|
||||
expectStartWith(video.files[0].fileUrl, ObjectStorageCommand.getMockWebTorrentBaseUrl())
|
||||
|
|
|
@ -149,7 +149,7 @@ describe('Test proxy', function () {
|
|||
await servers[0].run(ObjectStorageCommand.getDefaultMockConfig(), { env: badEnv })
|
||||
|
||||
const { uuid } = await servers[0].videos.quickUpload({ name: 'video' })
|
||||
await waitJobs(servers)
|
||||
await waitJobs(servers, { skipDelayed: true })
|
||||
|
||||
const video = await servers[0].videos.get({ id: uuid })
|
||||
|
||||
|
|
|
@ -4,7 +4,14 @@ import { wait } from '@shared/core-utils'
|
|||
import { JobState, JobType } from '../../models'
|
||||
import { PeerTubeServer } from './server'
|
||||
|
||||
async function waitJobs (serversArg: PeerTubeServer[] | PeerTubeServer, skipDelayed = false) {
|
||||
async function waitJobs (
|
||||
serversArg: PeerTubeServer[] | PeerTubeServer,
|
||||
options: {
|
||||
skipDelayed?: boolean // default false
|
||||
} = {}
|
||||
) {
|
||||
const { skipDelayed = false } = options
|
||||
|
||||
const pendingJobWait = process.env.NODE_PENDING_JOB_WAIT
|
||||
? parseInt(process.env.NODE_PENDING_JOB_WAIT, 10)
|
||||
: 250
|
||||
|
|
Loading…
Reference in New Issue