[ML] Fix assertion for delete ingest pipelines api (#167451)

This commit is contained in:
Quynh Nguyen (Quinn) 2023-09-28 10:54:37 -05:00 committed by GitHub
parent 274fe1e9d0
commit f5d223b253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -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 () => {

View file

@ -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');
},