From 261dac403a6380ea46f4f0bee8d50c6f661fbdfa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 15 May 2023 15:41:31 +0200 Subject: [PATCH] More robust test --- server/tests/api/users/users-multiple-servers.ts | 2 -- .../server-commands/videos/streaming-playlists-command.ts | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts index f94191b04..8d9436247 100644 --- a/server/tests/api/users/users-multiple-servers.ts +++ b/server/tests/api/users/users-multiple-servers.ts @@ -148,8 +148,6 @@ describe('Test users with multiple servers', function () { }) it('Should search through account videos', async function () { - this.timeout(10_000) - const created = await servers[0].videos.upload({ token: userAccessToken, attributes: { name: 'Kami no chikara' } }) await waitJobs(servers) diff --git a/shared/server-commands/videos/streaming-playlists-command.ts b/shared/server-commands/videos/streaming-playlists-command.ts index 87aacc5f6..b988ac4b2 100644 --- a/shared/server-commands/videos/streaming-playlists-command.ts +++ b/shared/server-commands/videos/streaming-playlists-command.ts @@ -14,7 +14,7 @@ export class StreamingPlaylistsCommand extends AbstractCommand { withRetry?: boolean // default false currentRetry?: number }): Promise { - const { videoFileToken, reinjectVideoFileToken, withRetry = false, currentRetry = 1 } = options + const { videoFileToken, reinjectVideoFileToken, expectedStatus, withRetry = false, currentRetry = 1 } = options try { const result = await unwrapTextOrDecode(this.getRawRequest({ @@ -29,6 +29,11 @@ export class StreamingPlaylistsCommand extends AbstractCommand { defaultExpectedStatus: HttpStatusCode.OK_200 })) + // master.m3u8 could be empty + if (!result && (!expectedStatus || expectedStatus === HttpStatusCode.OK_200)) { + throw new Error('Empty result') + } + return result } catch (err) { if (!withRetry || currentRetry > 10) throw err -- 2.41.0