Skip to content

Commit

Permalink
test: update upgrade assistant integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Mar 6, 2020
1 parent d2355b4 commit 97d6d72
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import expect from '@kbn/expect';

import { ReindexStatus, REINDEX_OP_TYPE } from '../../../plugins/upgrade_assistant/common/types';
import { generateNewIndexName } from '../../../plugins/upgrade_assistant/server/lib/reindexing/index_settings';
import { getIndexStateFromClusterState } from '../../../plugins/upgrade_assistant/common/get_index_state_from_cluster_state';

export default function({ getService }) {
const supertest = getService('supertest');
Expand Down Expand Up @@ -187,6 +188,8 @@ export default function({ getService }) {
await es.indices.create({ index: test2 });
await es.indices.create({ index: test3 });

await es.indices.close({ index: test1 });

const result = await supertest
.post(`/api/upgrade_assistant/reindex/batch`)
.set('kbn-xsrf', 'xxx')
Expand All @@ -206,6 +209,18 @@ export default function({ getService }) {
await waitForReindexToComplete(test3);

await assertQueueState(undefined, 0);

// Check that the closed index is still closed after reindexing
const clusterStateResponse = await es.cluster.state({
index: generateNewIndexName(test1),
metric: 'metadata',
});

const test1ReindexedState = getIndexStateFromClusterState(
generateNewIndexName(test1),
clusterStateResponse
);
expect(test1ReindexedState).to.be('close');
} finally {
await cleanupReindex(test1);
await cleanupReindex(test2);
Expand Down

0 comments on commit 97d6d72

Please sign in to comment.