aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-15 15:41:31 +0200
committerChocobozzz <me@florianbigard.com>2023-05-15 15:42:16 +0200
commit261dac403a6380ea46f4f0bee8d50c6f661fbdfa (patch)
treefa90fdc94a54a16154ff3511ae3a92ac95fe1179
parent5a05c14573ca3c0d16b77bef78d845f96c8c6497 (diff)
downloadPeerTube-261dac403a6380ea46f4f0bee8d50c6f661fbdfa.tar.gz
PeerTube-261dac403a6380ea46f4f0bee8d50c6f661fbdfa.tar.zst
PeerTube-261dac403a6380ea46f4f0bee8d50c6f661fbdfa.zip
More robust test
-rw-r--r--server/tests/api/users/users-multiple-servers.ts2
-rw-r--r--shared/server-commands/videos/streaming-playlists-command.ts7
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 () {
148 }) 148 })
149 149
150 it('Should search through account videos', async function () { 150 it('Should search through account videos', async function () {
151 this.timeout(10_000)
152
153 const created = await servers[0].videos.upload({ token: userAccessToken, attributes: { name: 'Kami no chikara' } }) 151 const created = await servers[0].videos.upload({ token: userAccessToken, attributes: { name: 'Kami no chikara' } })
154 152
155 await waitJobs(servers) 153 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 {
14 withRetry?: boolean // default false 14 withRetry?: boolean // default false
15 currentRetry?: number 15 currentRetry?: number
16 }): Promise<string> { 16 }): Promise<string> {
17 const { videoFileToken, reinjectVideoFileToken, withRetry = false, currentRetry = 1 } = options 17 const { videoFileToken, reinjectVideoFileToken, expectedStatus, withRetry = false, currentRetry = 1 } = options
18 18
19 try { 19 try {
20 const result = await unwrapTextOrDecode(this.getRawRequest({ 20 const result = await unwrapTextOrDecode(this.getRawRequest({
@@ -29,6 +29,11 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
29 defaultExpectedStatus: HttpStatusCode.OK_200 29 defaultExpectedStatus: HttpStatusCode.OK_200
30 })) 30 }))
31 31
32 // master.m3u8 could be empty
33 if (!result && (!expectedStatus || expectedStatus === HttpStatusCode.OK_200)) {
34 throw new Error('Empty result')
35 }
36
32 return result 37 return result
33 } catch (err) { 38 } catch (err) {
34 if (!withRetry || currentRetry > 10) throw err 39 if (!withRetry || currentRetry > 10) throw err