From 644391bee644c9078695ab042743d108870de7ef Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 May 2023 13:57:06 +0200 Subject: Fix test cleanup --- server/tests/api/check-params/videos.ts | 2 +- server/tests/api/object-storage/live.ts | 4 ++-- server/tests/api/object-storage/video-imports.ts | 4 ++-- server/tests/api/object-storage/videos.ts | 2 +- server/tests/api/videos/video-channel-syncs.ts | 4 ++-- shared/server-commands/server/servers-command.ts | 1 + shared/server-commands/videos/streaming-playlists-command.ts | 6 +++--- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 572ca8997..094ab6891 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts @@ -437,7 +437,7 @@ describe('Test videos API validator', function () { }) it('Should succeed with the correct parameters', async function () { - this.timeout(10000) + this.timeout(30000) const fields = baseCorrectParams diff --git a/server/tests/api/object-storage/live.ts b/server/tests/api/object-storage/live.ts index c430cd0a0..7f8db40e5 100644 --- a/server/tests/api/object-storage/live.ts +++ b/server/tests/api/object-storage/live.ts @@ -5,10 +5,10 @@ import { expectStartWith, MockObjectStorageProxy, SQLCommand, testLiveVideoResol import { areMockObjectStorageTestsDisabled } from '@shared/core-utils' import { HttpStatusCode, LiveVideoCreate, VideoPrivacy } from '@shared/models' import { + cleanupTests, createMultipleServers, doubleFollow, findExternalSavedVideo, - killallServers, makeRawRequest, ObjectStorageCommand, PeerTubeServer, @@ -290,6 +290,6 @@ describe('Object storage for lives', function () { after(async function () { await sqlCommandServer1.cleanup() - await killallServers(servers) + await cleanupTests(servers) }) }) diff --git a/server/tests/api/object-storage/video-imports.ts b/server/tests/api/object-storage/video-imports.ts index 11c866411..d5fd91b6a 100644 --- a/server/tests/api/object-storage/video-imports.ts +++ b/server/tests/api/object-storage/video-imports.ts @@ -5,8 +5,8 @@ import { expectStartWith, FIXTURE_URLS } from '@server/tests/shared' import { areMockObjectStorageTestsDisabled } from '@shared/core-utils' import { HttpStatusCode, VideoPrivacy } from '@shared/models' import { + cleanupTests, createSingleServer, - killallServers, makeRawRequest, ObjectStorageCommand, PeerTubeServer, @@ -103,6 +103,6 @@ describe('Object storage for video import', function () { }) after(async function () { - await killallServers([ server ]) + await cleanupTests([ server ]) }) }) diff --git a/server/tests/api/object-storage/videos.ts b/server/tests/api/object-storage/videos.ts index e90753d09..fe0720294 100644 --- a/server/tests/api/object-storage/videos.ts +++ b/server/tests/api/object-storage/videos.ts @@ -389,7 +389,7 @@ describe('Object storage for videos', function () { }) after(async function () { - await killallServers([ server ]) + await cleanupTests([ server ]) }) }) diff --git a/server/tests/api/videos/video-channel-syncs.ts b/server/tests/api/videos/video-channel-syncs.ts index a31e48d1d..12c2c158e 100644 --- a/server/tests/api/videos/video-channel-syncs.ts +++ b/server/tests/api/videos/video-channel-syncs.ts @@ -5,9 +5,9 @@ import { FIXTURE_URLS, SQLCommand } from '@server/tests/shared' import { areHttpImportTestsDisabled } from '@shared/core-utils' import { VideoChannelSyncState, VideoInclude, VideoPrivacy } from '@shared/models' import { + cleanupTests, createMultipleServers, getServerImportConfig, - killallServers, PeerTubeServer, setAccessTokensToServers, setDefaultAccountAvatar, @@ -309,7 +309,7 @@ describe('Test channel synchronizations', function () { await sqlCommand.cleanup() } - await killallServers(servers) + await cleanupTests(servers) }) }) } diff --git a/shared/server-commands/server/servers-command.ts b/shared/server-commands/server/servers-command.ts index 19645cb93..f174a2aa0 100644 --- a/shared/server-commands/server/servers-command.ts +++ b/shared/server-commands/server/servers-command.ts @@ -44,6 +44,7 @@ export class ServersCommand extends AbstractCommand { await copy(origin, join('artifacts', destname)) } + console.log(this.server.parallel) if (this.server.parallel) { const promise = saveGithubLogsIfNeeded() diff --git a/shared/server-commands/videos/streaming-playlists-command.ts b/shared/server-commands/videos/streaming-playlists-command.ts index 950808b60..e7448aa69 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, currentRetry = 1 } = options + const { videoFileToken, reinjectVideoFileToken, withRetry = false, currentRetry = 1 } = options try { const result = await unwrapTextOrDecode(this.getRawRequest({ @@ -51,7 +51,7 @@ export class StreamingPlaylistsCommand extends AbstractCommand { withRetry?: boolean // default false currentRetry?: number }) { - const { withRetry, currentRetry = 1 } = options + const { withRetry = false, currentRetry = 1 } = options try { const result = await unwrapBody(this.getRawRequest({ @@ -85,7 +85,7 @@ export class StreamingPlaylistsCommand extends AbstractCommand { withRetry?: boolean // default false currentRetry?: number }) { - const { withRetry, currentRetry = 1 } = options + const { withRetry = false, currentRetry = 1 } = options try { const result = await unwrapBodyOrDecodeToJSON<{ [ id: string ]: string }>(this.getRawRequest({ -- cgit v1.2.3