1
0
Fork 0

Fix tests

This commit is contained in:
Chocobozzz 2025-02-12 10:33:34 +01:00
parent 27d14308e5
commit cb5f0b8959
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 5 additions and 2 deletions

View file

@ -7,10 +7,11 @@ async function waitJobs (
serversArg: PeerTubeServer[] | PeerTubeServer,
options: {
skipDelayed?: boolean // default false
skipFailed?: boolean // default false
runnerJobs?: boolean // default false
} = {}
) {
const { skipDelayed = false, runnerJobs = false } = options
const { skipDelayed = false, skipFailed = false, runnerJobs = false } = options
const pendingJobWait = process.env.NODE_PENDING_JOB_WAIT
? parseInt(process.env.NODE_PENDING_JOB_WAIT, 10)
@ -69,6 +70,8 @@ async function waitJobs (
.then(({ data }) => {
for (const job of data) {
if (job.state.id !== RunnerJobState.COMPLETED) {
if (skipFailed && job.state.id === RunnerJobState.ERRORED) continue
pendingRequests = true
if (process.env.DEBUG) {

View file

@ -109,7 +109,7 @@ describe('Test transcription in peertube-runner program', function () {
this.timeout(360000)
const uuid = await uploadForTranscription(servers[0])
await waitJobs(servers, { runnerJobs: true })
await waitJobs(servers, { runnerJobs: true, skipFailed: true }) // skipFailed because previous test had a failed runner job
await checkAutoCaption({ servers, uuid, objectStorageBaseUrl: objectStorage.getMockCaptionFileBaseUrl() })
await checkLanguage(servers, uuid, 'en')