Skip to content

Commit

Permalink
adds a check to only delete index if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Oct 9, 2023
1 parent daa1b78 commit e3ca450
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,14 @@ export function LogRateAnalysisDataGeneratorProvider({ getService }: FtrProvider
case 'artificial_logs_with_dip_notextfield':
case 'artificial_logs_with_dip_textfield':
try {
await es.indices.delete({
const indexExists = await es.indices.exists({
index: dataGenerator,
});
if (indexExists) {
await es.indices.delete({
index: dataGenerator,
});
}
} catch (e) {
log.info(`Could not delete index '${dataGenerator}' in before() callback`);
}
Expand Down

0 comments on commit e3ca450

Please sign in to comment.