diff --git a/test/common/services/es_archiver.ts b/test/common/services/es_archiver.ts index cf8474662306b..e72bb49a76c0d 100644 --- a/test/common/services/es_archiver.ts +++ b/test/common/services/es_archiver.ts @@ -46,6 +46,7 @@ export function EsArchiverProvider({ getService, hasService }: FtrProviderContex KibanaServer.extendEsArchiver({ esArchiver, kibanaServer: getService('kibanaServer'), + retry: getService('retry'), defaults: config.get('uiSettings.defaults'), }); } diff --git a/test/common/services/kibana_server/extend_es_archiver.js b/test/common/services/kibana_server/extend_es_archiver.js index 30ac65b81bc6a..d934e6725a9f5 100644 --- a/test/common/services/kibana_server/extend_es_archiver.js +++ b/test/common/services/kibana_server/extend_es_archiver.js @@ -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; diff --git a/x-pack/test/saved_object_api_integration/common/services/index.ts b/x-pack/test/saved_object_api_integration/common/services/index.ts index 7c201af3ef469..dc2f023c0ba02 100644 --- a/x-pack/test/saved_object_api_integration/common/services/index.ts +++ b/x-pack/test/saved_object_api_integration/common/services/index.ts @@ -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, }; diff --git a/x-pack/test/spaces_api_integration/common/config.ts b/x-pack/test/spaces_api_integration/common/config.ts index 4c8cc3a8234ee..daf3b45982a34 100644 --- a/x-pack/test/spaces_api_integration/common/config.ts +++ b/x-pack/test/spaces_api_integration/common/config.ts @@ -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'), },