From ecdc91b2210573563f8ebef86d50ecf8588efbb1 Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Sun, 24 Feb 2019 14:01:17 +0100 Subject: [PATCH] Leave more room for Authelia to spawn and terminate. --- test/helpers/context/WithAutheliaRunning.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/helpers/context/WithAutheliaRunning.ts b/test/helpers/context/WithAutheliaRunning.ts index f6de89c0..9250be5c 100644 --- a/test/helpers/context/WithAutheliaRunning.ts +++ b/test/helpers/context/WithAutheliaRunning.ts @@ -1,9 +1,9 @@ import ChildProcess from 'child_process'; -export default function WithAutheliaRunning(configPath: string, waitTimeout: number = 3000) { +export default function WithAutheliaRunning(configPath: string, waitTimeout: number = 5000) { before(function() { - this.timeout(5000); + this.timeout(10000); console.log('Spawning Authelia server with configuration %s.', configPath); const authelia = ChildProcess.spawn( @@ -21,10 +21,14 @@ export default function WithAutheliaRunning(configPath: string, waitTimeout: num }); after(function() { - this.timeout(1000); + this.timeout(10000); console.log('Killing Authelia server.'); // Kill the group of processes. process.kill(-this.authelia.pid); + + // Leave 5 seconds for the process to terminate. + const waitPromise = new Promise((resolve, reject) => setTimeout(() => resolve(), 5000)); + return waitPromise; }); } \ No newline at end of file