esArchiver: retry kibana config update (#43987)

* [services/es_archiver] retry uiSettings update

* run x-pack-ciGroup7 30x times

* Revert "run x-pack-ciGroup7 30x times"

This reverts commit 80e199c3aa.

* [saved_object_api_integration/common/services] add retry service to the set

* add retry service for x-pack api tests
This commit is contained in:
Dmitry Lemeshko 2019-08-27 23:15:29 +02:00 committed by GitHub
parent 697033f076
commit 48c610968e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 2 deletions

View file

@ -46,6 +46,7 @@ export function EsArchiverProvider({ getService, hasService }: FtrProviderContex
KibanaServer.extendEsArchiver({
esArchiver,
kibanaServer: getService('kibanaServer'),
retry: getService('retry'),
defaults: config.get('uiSettings.defaults'),
});
}

View file

@ -20,7 +20,7 @@
const ES_ARCHIVER_LOAD_METHODS = ['load', 'loadIfNeeded', 'unload'];
const KIBANA_INDEX = '.kibana';
export function extendEsArchiver({ esArchiver, kibanaServer, defaults }) {
export function extendEsArchiver({ esArchiver, kibanaServer, retry, defaults }) {
// only extend the esArchiver if there are default uiSettings to restore
if (!defaults) {
return;
@ -36,7 +36,9 @@ export function extendEsArchiver({ esArchiver, kibanaServer, defaults }) {
// if the kibana index was created by the esArchiver then update the uiSettings
// with the defaults to make sure that they are always in place initially
if (stats[KIBANA_INDEX] && (stats[KIBANA_INDEX].created || stats[KIBANA_INDEX].deleted)) {
await kibanaServer.uiSettings.update(defaults);
await retry.try(async () => {
await kibanaServer.uiSettings.update(defaults);
});
}
return stats;

View file

@ -16,6 +16,7 @@ export const services = {
esSupertestWithoutAuth: apiIntegrationServices.esSupertestWithoutAuth,
supertest: kibanaApiIntegrationServices.supertest,
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
retry: kibanaApiIntegrationServices.retry,
esArchiver: kibanaFunctionalServices.esArchiver,
kibanaServer: kibanaFunctionalServices.kibanaServer,
};

View file

@ -38,6 +38,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
esSupertestWithoutAuth: config.xpack.api.get('services.esSupertestWithoutAuth'),
supertest: config.kibana.api.get('services.supertest'),
supertestWithoutAuth: config.xpack.api.get('services.supertestWithoutAuth'),
retry: config.xpack.api.get('services.retry'),
esArchiver: config.kibana.functional.get('services.esArchiver'),
kibanaServer: config.kibana.functional.get('services.kibanaServer'),
},