Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esArchiver: retry kibana config update #43987

Merged
merged 5 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/common/services/es_archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function EsArchiverProvider({ getService, hasService }: FtrProviderContex
KibanaServer.extendEsArchiver({
esArchiver,
kibanaServer: getService('kibanaServer'),
retry: getService('retry'),
defaults: config.get('uiSettings.defaults'),
});
}
Expand Down
6 changes: 4 additions & 2 deletions test/common/services/kibana_server/extend_es_archiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 1 addition & 0 deletions x-pack/test/spaces_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
},
Expand Down