Skip to content

Commit

Permalink
Fix assertion for delete ingest pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Sep 27, 2023
1 parent 9fba1e3 commit 1c22d8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ export default ({ getService }: FtrProviderContext) => {
});

after(async () => {
await ml.api.cleanMlIndices();
await esDeleteAllIndices('user-index_dfa*');

// delete created ingest pipelines
await Promise.all(
['dfa_regression_model_alias', ...testModelIds].map((modelId) =>
ml.api.deleteIngestPipeline(modelId)
)
);
await ml.api.cleanMlIndices();
await ml.testResources.cleanMLSavedObjects();

await esDeleteAllIndices('user-index_dfa*');
});

it('returns all trained models with associated pipelines including aliases', async () => {
Expand Down
8 changes: 4 additions & 4 deletions x-pack/test/functional/services/ml/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1504,10 +1504,10 @@ export function MachineLearningAPIProvider({ getService }: FtrProviderContext) {

async deleteIngestPipeline(modelId: string, usePrefix: boolean = true) {
log.debug(`Deleting ingest pipeline for trained model with id "${modelId}"`);
// const { body, status } =
await esSupertest.delete(`/_ingest/pipeline/${usePrefix ? 'pipeline_' : ''}${modelId}`);
// @todo
// this.assertResponseStatusCode(200, status, body);
const { body, status } = await esSupertest.delete(
`/_ingest/pipeline/${usePrefix ? 'pipeline_' : ''}${modelId}`
);
this.assertResponseStatusCode(200, status, body);

log.debug('> Ingest pipeline deleted');
},
Expand Down

0 comments on commit 1c22d8e

Please sign in to comment.