diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/transcoding/video-studio.ts | 25 | ||||
-rw-r--r-- | server/tests/shared/directories.ts | 5 |
2 files changed, 29 insertions, 1 deletions
diff --git a/server/tests/api/transcoding/video-studio.ts b/server/tests/api/transcoding/video-studio.ts index ab08e8fb6..30f72e6e9 100644 --- a/server/tests/api/transcoding/video-studio.ts +++ b/server/tests/api/transcoding/video-studio.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { expect } from 'chai' | 1 | import { expect } from 'chai' |
2 | import { expectStartWith } from '@server/tests/shared' | 2 | import { checkPersistentTmpIsEmpty, expectStartWith } from '@server/tests/shared' |
3 | import { areMockObjectStorageTestsDisabled, getAllFiles } from '@shared/core-utils' | 3 | import { areMockObjectStorageTestsDisabled, getAllFiles } from '@shared/core-utils' |
4 | import { VideoStudioTask } from '@shared/models' | 4 | import { VideoStudioTask } from '@shared/models' |
5 | import { | 5 | import { |
@@ -356,6 +356,29 @@ describe('Test video studio', function () { | |||
356 | }) | 356 | }) |
357 | }) | 357 | }) |
358 | 358 | ||
359 | describe('Server restart', function () { | ||
360 | |||
361 | it('Should still be able to run video edition after a server restart', async function () { | ||
362 | this.timeout(240_000) | ||
363 | |||
364 | await renewVideo() | ||
365 | await servers[0].videoStudio.createEditionTasks({ videoId: videoUUID, tasks: VideoStudioCommand.getComplexTask() }) | ||
366 | |||
367 | await servers[0].kill() | ||
368 | await servers[0].run() | ||
369 | |||
370 | await waitJobs(servers) | ||
371 | |||
372 | for (const server of servers) { | ||
373 | await checkDuration(server, 9) | ||
374 | } | ||
375 | }) | ||
376 | |||
377 | it('Should have an empty persistent tmp directory', async function () { | ||
378 | await checkPersistentTmpIsEmpty(servers[0]) | ||
379 | }) | ||
380 | }) | ||
381 | |||
359 | after(async function () { | 382 | after(async function () { |
360 | await cleanupTests(servers) | 383 | await cleanupTests(servers) |
361 | }) | 384 | }) |
diff --git a/server/tests/shared/directories.ts b/server/tests/shared/directories.ts index 90d534a06..a614cef7c 100644 --- a/server/tests/shared/directories.ts +++ b/server/tests/shared/directories.ts | |||
@@ -12,6 +12,10 @@ async function checkTmpIsEmpty (server: PeerTubeServer) { | |||
12 | } | 12 | } |
13 | } | 13 | } |
14 | 14 | ||
15 | async function checkPersistentTmpIsEmpty (server: PeerTubeServer) { | ||
16 | await checkDirectoryIsEmpty(server, 'tmp-persistent') | ||
17 | } | ||
18 | |||
15 | async function checkDirectoryIsEmpty (server: PeerTubeServer, directory: string, exceptions: string[] = []) { | 19 | async function checkDirectoryIsEmpty (server: PeerTubeServer, directory: string, exceptions: string[] = []) { |
16 | const directoryPath = server.getDirectoryPath(directory) | 20 | const directoryPath = server.getDirectoryPath(directory) |
17 | 21 | ||
@@ -26,5 +30,6 @@ async function checkDirectoryIsEmpty (server: PeerTubeServer, directory: string, | |||
26 | 30 | ||
27 | export { | 31 | export { |
28 | checkTmpIsEmpty, | 32 | checkTmpIsEmpty, |
33 | checkPersistentTmpIsEmpty, | ||
29 | checkDirectoryIsEmpty | 34 | checkDirectoryIsEmpty |
30 | } | 35 | } |