From db66e3df7559d78d129da4628e1cff360fa0602f Mon Sep 17 00:00:00 2001 From: Joachim Van Herwegen Date: Thu, 5 Oct 2023 09:46:09 +0200 Subject: [PATCH] test: Consistently clean up folder before stopping server There seems to be some integration tests that sometimes fail on tests where the order is reversed. Hopefully this resolves the problem. --- test/integration/Quota.test.ts | 4 ++-- test/integration/ResourceLockCleanup.test.ts | 5 +---- test/integration/SeedingPods.test.ts | 2 +- test/integration/WebHookChannel2023.test.ts | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/test/integration/Quota.test.ts b/test/integration/Quota.test.ts index 81b429db5..66ebaf55a 100644 --- a/test/integration/Quota.test.ts +++ b/test/integration/Quota.test.ts @@ -112,8 +112,8 @@ describe('A quota server', (): void => { }); afterAll(async(): Promise => { - await app.stop(); await removeFolder(rootFilePath); + await app.stop(); }); // Test quota in the first pod @@ -198,8 +198,8 @@ describe('A quota server', (): void => { }); afterAll(async(): Promise => { - await app.stop(); await removeFolder(rootFilePath); + await app.stop(); }); it('should return 413 when global quota is exceeded.', async(): Promise => { diff --git a/test/integration/ResourceLockCleanup.test.ts b/test/integration/ResourceLockCleanup.test.ts index b6ba484f8..4a054dd75 100644 --- a/test/integration/ResourceLockCleanup.test.ts +++ b/test/integration/ResourceLockCleanup.test.ts @@ -53,11 +53,8 @@ void => { }); afterAll(async(): Promise => { - // Stop the server - await app.stop(); - - // Execute the configured teardown await teardown(); + await app.stop(); }); it('should not be affected by dangling locks.', async(): Promise => { diff --git a/test/integration/SeedingPods.test.ts b/test/integration/SeedingPods.test.ts index 349739fd2..9a49e411e 100644 --- a/test/integration/SeedingPods.test.ts +++ b/test/integration/SeedingPods.test.ts @@ -45,8 +45,8 @@ describe('A server with seeded pods', (): void => { }); afterAll(async(): Promise => { - await app.stop(); await removeFolder(rootFilePath); + await app.stop(); }); it('has created the requested pods.', async(): Promise => { diff --git a/test/integration/WebHookChannel2023.test.ts b/test/integration/WebHookChannel2023.test.ts index 3a78d128a..9cea59371 100644 --- a/test/integration/WebHookChannel2023.test.ts +++ b/test/integration/WebHookChannel2023.test.ts @@ -74,8 +74,8 @@ describe.each(stores)('A server supporting WebHookChannel2023 using %s', (name, afterAll(async(): Promise => { clientServer.close(); - await app.stop(); await teardown(); + await app.stop(); }); it('links to the storage description.', async(): Promise => {