Skip to content

Commit

Permalink
EsArchiver clean task manager indices to fix alerting api integration…
Browse files Browse the repository at this point in the history
… tests
  • Loading branch information
rudolf committed Jan 27, 2021
1 parent b82616d commit 329b9c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 4 additions & 3 deletions packages/kbn-es-archiver/src/lib/indices/kibana_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export async function migrateKibanaIndex({
async function fetchKibanaIndices(client: Client) {
const kibanaIndices = await client.cat.indices({ index: '.kibana*', format: 'json' });
const isKibanaIndex = (index: string) =>
/^\.kibana(:?_\d*)?$/.test(index) || /^\.kibana_(pre)*\d+\.\d+\.\d+/.test(index);
/^\.kibana(:?_\d*)?$/.test(index) ||
/^\.kibana(_task_manager)?_(pre)?\d+\.\d+\.\d+/.test(index);
return kibanaIndices.map((x: { index: string }) => x.index).filter(isKibanaIndex);
}

Expand All @@ -104,7 +105,7 @@ export async function cleanKibanaIndices({

while (true) {
const resp = await client.deleteByQuery({
index: `.kibana`,
index: `.kibana,.kibana_task_manager`,
body: {
query: {
bool: {
Expand All @@ -116,7 +117,7 @@ export async function cleanKibanaIndices({
},
},
},
ignore: [409],
ignore: [404, 409],
});

if (resp.total !== resp.deleted) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import { setupSpacesAndUsers, tearDown } from '..';
export default function alertingTests({ loadTestFile, getService }: FtrProviderContext) {
describe('Alerts', () => {
describe('legacy alerts', () => {
before(async () => {
await setupSpacesAndUsers(getService);
});

after(async () => {
await tearDown(getService);
});
Expand Down

0 comments on commit 329b9c6

Please sign in to comment.