More robust runner socket test

pull/5897/head
Chocobozzz 2023-07-19 10:34:21 +02:00
parent bfd01f289d
commit 15c2303489
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 24 additions and 20 deletions

View File

@ -58,18 +58,20 @@ describe('Test runner socket', function () {
localSocket.on('available-jobs', () => pings++)
await server.videos.quickUpload({ name: 'video1' })
// Wait for debounce
await wait(1000)
await waitJobs([ server ])
expect(pings).to.equal(1)
// eslint-disable-next-line no-unmodified-loop-condition
while (pings !== 1) {
await wait(500)
}
await server.videos.quickUpload({ name: 'video2' })
// Wait for debounce
await wait(1000)
await waitJobs([ server ])
expect(pings).to.equal(2)
// eslint-disable-next-line no-unmodified-loop-condition
while ((pings as number) !== 2) {
await wait(500)
}
await server.runnerJobs.cancelAllJobs()
})
@ -80,18 +82,20 @@ describe('Test runner socket', function () {
localSocket.on('available-jobs', () => pings++)
await server.videos.quickUpload({ name: 'video3' })
// Wait for debounce
await wait(1000)
await waitJobs([ server ])
expect(pings).to.equal(1)
// eslint-disable-next-line no-unmodified-loop-condition
while (pings !== 1) {
await wait(500)
}
await server.runnerJobs.autoProcessWebVideoJob(runnerToken)
// Wait for debounce
await wait(1000)
await waitJobs([ server ])
expect(pings).to.equal(2)
// eslint-disable-next-line no-unmodified-loop-condition
while ((pings as number) !== 2) {
await wait(500)
}
})
it('Should not send a ping if the ended job does not have a child', async function () {

View File

@ -63,7 +63,7 @@ describe('Test video storyboard', function () {
})
it('Should generate a storyboard after upload without transcoding', async function () {
this.timeout(60000)
this.timeout(120000)
// 5s video
const { uuid } = await servers[0].videos.quickUpload({ name: 'upload', fixture: 'video_short.webm' })
@ -76,7 +76,7 @@ describe('Test video storyboard', function () {
})
it('Should generate a storyboard after upload without transcoding with a long video', async function () {
this.timeout(60000)
this.timeout(120000)
// 124s video
const { uuid } = await servers[0].videos.quickUpload({ name: 'upload', fixture: 'video_very_long_10p.mp4' })
@ -88,7 +88,7 @@ describe('Test video storyboard', function () {
})
it('Should generate a storyboard after upload with transcoding', async function () {
this.timeout(60000)
this.timeout(120000)
await servers[0].config.enableMinimumTranscoding()
@ -102,7 +102,7 @@ describe('Test video storyboard', function () {
})
it('Should generate a storyboard after an audio upload', async function () {
this.timeout(60000)
this.timeout(120000)
// 6s audio
const attributes = { name: 'audio', fixture: 'sample.ogg' }
@ -119,7 +119,7 @@ describe('Test video storyboard', function () {
})
it('Should generate a storyboard after HTTP import', async function () {
this.timeout(60000)
this.timeout(120000)
if (areHttpImportTestsDisabled()) return
@ -139,7 +139,7 @@ describe('Test video storyboard', function () {
})
it('Should generate a storyboard after torrent import', async function () {
this.timeout(60000)
this.timeout(120000)
if (areHttpImportTestsDisabled()) return