authelia/test/complete-config/mongo-broken-connection.ts
Clément Michaud c503765dd6
Implement retry mechanism for broken connections to mongo (#258)
Before this patch, when Authelia started, if Mongo was not
up and running, Authelia failed to connect and never retried.
Now, everytime Authelia faces a broken connection, it tries
to reconnect during the next operation.
2018-08-19 16:51:36 +02:00

20 lines
733 B
TypeScript

require("chromedriver");
import SeleniumWebdriver = require("selenium-webdriver");
import WithDriver from '../helpers/with-driver';
import LoginAndRegisterTotp from '../helpers/login-and-register-totp';
import LoginAs from '../helpers/login-as';
import VisitPage from '../helpers/visit-page';
describe('Connection retry when mongo fails or restarts', function() {
this.timeout(20000);
WithDriver();
it('should be able to login after mongo restarts', function() {
const that = this;
return that.environment.stop_service("mongo")
.then(() => that.environment.restart_service("authelia", 2000))
.then(() => that.environment.restart_service("mongo"))
.then(() => LoginAs(that.driver, "john"));
})
});