mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
Leave more room for Authelia to spawn and terminate.
This commit is contained in:
parent
afb39fc8d0
commit
ecdc91b221
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
import ChildProcess from 'child_process';
|
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() {
|
before(function() {
|
||||||
this.timeout(5000);
|
this.timeout(10000);
|
||||||
|
|
||||||
console.log('Spawning Authelia server with configuration %s.', configPath);
|
console.log('Spawning Authelia server with configuration %s.', configPath);
|
||||||
const authelia = ChildProcess.spawn(
|
const authelia = ChildProcess.spawn(
|
||||||
|
@ -21,10 +21,14 @@ export default function WithAutheliaRunning(configPath: string, waitTimeout: num
|
||||||
});
|
});
|
||||||
|
|
||||||
after(function() {
|
after(function() {
|
||||||
this.timeout(1000);
|
this.timeout(10000);
|
||||||
|
|
||||||
console.log('Killing Authelia server.');
|
console.log('Killing Authelia server.');
|
||||||
// Kill the group of processes.
|
// Kill the group of processes.
|
||||||
process.kill(-this.authelia.pid);
|
process.kill(-this.authelia.pid);
|
||||||
|
|
||||||
|
// Leave 5 seconds for the process to terminate.
|
||||||
|
const waitPromise = new Promise((resolve, reject) => setTimeout(() => resolve(), 5000));
|
||||||
|
return waitPromise;
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user