[esArchiver] refresh all, stop being too clever (#35186)

* [esArchiver] refresh all, stop being too clever

* wait for save notification before ending tests

I have a hunch that Timelion/Kibana are still mucking with the .kibana index when the test ends, and the `esArchiver.unload()` call is conflicting because of those modifications being still in progress.
This commit is contained in:
Spencer 2019-04-17 08:20:23 -07:00 committed by GitHub
parent c0edcbe9ab
commit 27bd635397
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 11 deletions

View file

@ -74,16 +74,15 @@ export async function loadAction({ name, skipExisting, client, dataDir, log, kib
const result = stats.toJSON();
const indicesToRefresh = Object
.entries(result)
.filter(([, stats]) => !stats.deleted)
.map(([index, { docs }]) => {
for (const [index, { docs }] of Object.entries(result)) {
if (!docs && docs.indexed > 0) {
log.info('[%s] Indexed %d docs into %j', name, docs.indexed, index);
return index;
});
}
}
await client.indices.refresh({
index: indicesToRefresh
index: '_all',
allowNoIndices: true,
});
// If we affected the Kibana index, we need to ensure it's migrated...

View file

@ -379,12 +379,13 @@ app.controller('timelion', function (
savedSheet.timelion_rows = $scope.state.rows;
savedSheet.save().then(function (id) {
if (id) {
toastNotifications.addSuccess(
i18n('timelion.saveSheet.successNotificationText', {
toastNotifications.addSuccess({
title: i18n('timelion.saveSheet.successNotificationText', {
defaultMessage: `Saved sheet '{title}'`,
values: { title: savedSheet.title },
})
);
}),
'data-test-subj': 'timelionSaveSuccessToast',
});
if (savedSheet.id !== $routeParams.id) {
kbnUrl.change('/{{id}}', { id: savedSheet.id });

View file

@ -73,6 +73,8 @@ export function TimelionPageProvider({ getService, getPageObjects }) {
await testSubjects.click('timelionSaveButton');
await testSubjects.click('timelionSaveAsSheetButton');
await testSubjects.click('timelionFinishSaveButton');
await testSubjects.existOrFail('timelionSaveSuccessToast');
await testSubjects.waitForDeleted('timelionSaveSuccessToast');
}
async expectWriteControls() {