From 3546128f95c9bab1ed83e75e5935fe1f97f3896d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Oct 2023 15:46:18 +0200 Subject: [PATCH 1/4] Workaround to bullmq undefined jobs --- server/core/lib/job-queue/job-queue.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/core/lib/job-queue/job-queue.ts b/server/core/lib/job-queue/job-queue.ts index 0f642446b..7922a830b 100644 --- a/server/core/lib/job-queue/job-queue.ts +++ b/server/core/lib/job-queue/job-queue.ts @@ -418,7 +418,11 @@ class JobQueue { continue } - const jobs = await queue.getJobs(states, 0, start + count, asc) + let jobs = await queue.getJobs(states, 0, start + count, asc) + + // FIXME: we have sometimes undefined values https://github.com/taskforcesh/bullmq/issues/248 + jobs = jobs.filter(j => !!j) + results = results.concat(jobs) } From 830907ec93a11a2f1ccecda08d4928d7f421fbce Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Oct 2023 15:47:41 +0200 Subject: [PATCH 2/4] Increase test timeouts --- packages/tests/src/api/transcoding/transcoder.ts | 6 +++--- packages/tests/src/api/videos/video-playlists.ts | 2 +- packages/tests/src/api/videos/video-source.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/tests/src/api/transcoding/transcoder.ts b/packages/tests/src/api/transcoding/transcoder.ts index bce525fb0..dd4948ee6 100644 --- a/packages/tests/src/api/transcoding/transcoder.ts +++ b/packages/tests/src/api/transcoding/transcoder.ts @@ -234,7 +234,7 @@ describe('Test video transcoding', function () { describe('Audio transcoding', function () { it('Should transcode high bit rate mp3 to proper bit rate', async function () { - this.timeout(60_000) + this.timeout(120_000) const attributes = { name: 'mp3_256k', @@ -266,7 +266,7 @@ describe('Test video transcoding', function () { }) it('Should transcode video with no audio and have no audio itself', async function () { - this.timeout(60_000) + this.timeout(120_000) const attributes = { name: 'no_audio', @@ -290,7 +290,7 @@ describe('Test video transcoding', function () { }) it('Should leave the audio untouched, but properly transcode the video', async function () { - this.timeout(60_000) + this.timeout(120_000) const attributes = { name: 'untouched_audio', diff --git a/packages/tests/src/api/videos/video-playlists.ts b/packages/tests/src/api/videos/video-playlists.ts index 77c8d6436..8908730cf 100644 --- a/packages/tests/src/api/videos/video-playlists.ts +++ b/packages/tests/src/api/videos/video-playlists.ts @@ -537,7 +537,7 @@ describe('Test video playlists', function () { describe('Element timestamps', function () { it('Should create a playlist containing different startTimestamp/endTimestamp videos', async function () { - this.timeout(30000) + this.timeout(60000) const addVideo = (attributes: any) => { return commands[0].addElement({ playlistId: playlistServer1Id, attributes }) diff --git a/packages/tests/src/api/videos/video-source.ts b/packages/tests/src/api/videos/video-source.ts index cbde5c4b2..02d21b64b 100644 --- a/packages/tests/src/api/videos/video-source.ts +++ b/packages/tests/src/api/videos/video-source.ts @@ -26,7 +26,7 @@ describe('Test a video file replacement', function () { let uuid: string before(async function () { - this.timeout(50000) + this.timeout(120000) servers = await createMultipleServers(2) From 0397b31efede632c51b341f73540e875fbcca656 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Oct 2023 15:53:17 +0200 Subject: [PATCH 3/4] Reduce views tests load --- packages/tests/src/shared/views.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/tests/src/shared/views.ts b/packages/tests/src/shared/views.ts index b791eff25..8d0fa567d 100644 --- a/packages/tests/src/shared/views.ts +++ b/packages/tests/src/shared/views.ts @@ -35,17 +35,8 @@ async function prepareViewsServers () { await setAccessTokensToServers(servers) await setDefaultVideoChannel(servers) - await servers[0].config.updateCustomSubConfig({ - newConfig: { - live: { - enabled: true, - allowReplay: true, - transcoding: { - enabled: false - } - } - } - }) + await servers[0].config.enableMinimumTranscoding() + await servers[0].config.enableLive({ allowReplay: true, transcoding: false }) await doubleFollow(servers[0], servers[1]) From ae468445b2bba97eb0419c9f4e3a58288d43c0c1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Oct 2023 15:57:11 +0200 Subject: [PATCH 4/4] Increase other test timeouts --- packages/tests/src/api/activitypub/cleaner.ts | 2 +- packages/tests/src/api/moderation/abuses.ts | 2 +- packages/tests/src/api/videos/video-channels.ts | 2 +- packages/tests/src/api/videos/video-playlists.ts | 2 +- packages/tests/src/api/videos/video-source.ts | 4 ++-- packages/tests/src/api/videos/video-storyboard.ts | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/tests/src/api/activitypub/cleaner.ts b/packages/tests/src/api/activitypub/cleaner.ts index 4476aea85..20415b9a4 100644 --- a/packages/tests/src/api/activitypub/cleaner.ts +++ b/packages/tests/src/api/activitypub/cleaner.ts @@ -23,7 +23,7 @@ describe('Test AP cleaner', function () { let videoUUIDs: string[] before(async function () { - this.timeout(120000) + this.timeout(240000) const config = { federation: { diff --git a/packages/tests/src/api/moderation/abuses.ts b/packages/tests/src/api/moderation/abuses.ts index 649de224e..68f759435 100644 --- a/packages/tests/src/api/moderation/abuses.ts +++ b/packages/tests/src/api/moderation/abuses.ts @@ -21,7 +21,7 @@ describe('Test abuses', function () { let commands: AbusesCommand[] before(async function () { - this.timeout(50000) + this.timeout(120000) // Run servers servers = await createMultipleServers(2) diff --git a/packages/tests/src/api/videos/video-channels.ts b/packages/tests/src/api/videos/video-channels.ts index 531c41e18..c431fc0eb 100644 --- a/packages/tests/src/api/videos/video-channels.ts +++ b/packages/tests/src/api/videos/video-channels.ts @@ -523,7 +523,7 @@ describe('Test video channels', function () { }) it('Should list channels by updatedAt desc if a video has been uploaded', async function () { - this.timeout(30000) + this.timeout(60000) await servers[0].videos.upload({ attributes: { channelId: totoChannel } }) await waitJobs(servers) diff --git a/packages/tests/src/api/videos/video-playlists.ts b/packages/tests/src/api/videos/video-playlists.ts index 8908730cf..18fc21e19 100644 --- a/packages/tests/src/api/videos/video-playlists.ts +++ b/packages/tests/src/api/videos/video-playlists.ts @@ -537,7 +537,7 @@ describe('Test video playlists', function () { describe('Element timestamps', function () { it('Should create a playlist containing different startTimestamp/endTimestamp videos', async function () { - this.timeout(60000) + this.timeout(120000) const addVideo = (attributes: any) => { return commands[0].addElement({ playlistId: playlistServer1Id, attributes }) diff --git a/packages/tests/src/api/videos/video-source.ts b/packages/tests/src/api/videos/video-source.ts index 02d21b64b..3a13f7279 100644 --- a/packages/tests/src/api/videos/video-source.ts +++ b/packages/tests/src/api/videos/video-source.ts @@ -111,7 +111,7 @@ describe('Test a video file replacement', function () { }) it('Should replace a video file with transcoding enabled', async function () { - this.timeout(120000) + this.timeout(240000) const previousPaths: string[] = [] @@ -384,7 +384,7 @@ describe('Test a video file replacement', function () { }) it('Should replace a video file with transcoding enabled', async function () { - this.timeout(120000) + this.timeout(240000) const previousPaths: string[] = [] diff --git a/packages/tests/src/api/videos/video-storyboard.ts b/packages/tests/src/api/videos/video-storyboard.ts index 7d156aa7f..39890e3ea 100644 --- a/packages/tests/src/api/videos/video-storyboard.ts +++ b/packages/tests/src/api/videos/video-storyboard.ts @@ -139,7 +139,7 @@ describe('Test video storyboard', function () { }) it('Should generate a storyboard after torrent import', async function () { - this.timeout(120000) + this.timeout(240000) if (areHttpImportTestsDisabled()) return