Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading