From 508c1b1e9f3b26752a961e945b7fa59b72b30827 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 25 Oct 2022 11:51:20 +0200 Subject: Correctly cleanup files from object storage --- .../object-storage/video-static-file-privacy.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'server/tests/api') diff --git a/server/tests/api/object-storage/video-static-file-privacy.ts b/server/tests/api/object-storage/video-static-file-privacy.ts index 981bbaa16..c6d7a1a2c 100644 --- a/server/tests/api/object-storage/video-static-file-privacy.ts +++ b/server/tests/api/object-storage/video-static-file-privacy.ts @@ -192,16 +192,6 @@ describe('Object storage for video static file privacy', function () { await checkPublicFiles(publicVideoUUID) }) - - after(async function () { - this.timeout(30000) - - if (privateVideoUUID) await server.videos.remove({ id: privateVideoUUID }) - if (publicVideoUUID) await server.videos.remove({ id: publicVideoUUID }) - if (userPrivateVideoUUID) await server.videos.remove({ id: userPrivateVideoUUID }) - - await waitJobs([ server ]) - }) }) describe('Live', function () { @@ -331,6 +321,18 @@ describe('Object storage for video static file privacy', function () { }) after(async function () { + this.timeout(60000) + + const { data } = await server.videos.listAllForAdmin() + + for (const v of data) { + await server.videos.remove({ id: v.uuid }) + } + + for (const v of data) { + await server.servers.waitUntilLog('Removed files of video ' + v.url, 1, true) + } + await cleanupTests([ server ]) }) }) -- cgit v1.2.3