Don't create pendingTranscription twice

This commit is contained in:
Chocobozzz
2024-07-03 08:32:14 +02:00
parent 91302ea12a
commit 2d26eff129
3 changed files with 19 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ describe('Test runner transcription', function () {
async function upload () {
const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video', language: undefined } })
await waitJobs(servers)
const { availableJobs } = await servers[0].runnerJobs.request({ runnerToken })
expect(availableJobs).to.have.lengthOf(1)
@@ -103,6 +104,23 @@ describe('Test runner transcription', function () {
}
})
it('Should error a transcription job and decrease the job count', async function () {
this.timeout(60000)
const { job, uuid } = await upload()
await servers[0].runnerJobs.error({ runnerToken, jobUUID: job.uuid, jobToken: job.jobToken, message: 'Error' })
for (let i = 0; i < 4; i++) {
const { job: { jobToken } } = await servers[0].runnerJobs.accept({ runnerToken, jobUUID: job.uuid })
await servers[0].runnerJobs.error({ runnerToken, jobUUID: job.uuid, jobToken, message: 'Error' })
}
await waitJobs(servers)
await servers[0].captions.runGenerate({ videoId: uuid })
})
after(async function () {
await cleanupTests(servers)
})