From 4b661dfa3de7161d03ea72b892cbfdbf7b8bade0 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Tue, 9 Jun 2020 13:55:14 +0200 Subject: [PATCH] [ML] Functional tests - fix job validation API test with maxModelMemoryLimit (#68501) (#68628) This PR fixes the job validation API integration test for the scenario that the test environment has xpack.ml.max_model_memory_limit set. --- .../api_integration/apis/ml/job_validation/validate.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x-pack/test/api_integration/apis/ml/job_validation/validate.ts b/x-pack/test/api_integration/apis/ml/job_validation/validate.ts index 55497940190cb..fc8f837744221 100644 --- a/x-pack/test/api_integration/apis/ml/job_validation/validate.ts +++ b/x-pack/test/api_integration/apis/ml/job_validation/validate.ts @@ -226,6 +226,15 @@ export default ({ getService }: FtrProviderContext) => { .send(requestBody) .expect(200); + // The existance and value of maxModelMemoryLimit depends on ES settings + // and may vary between test environments, e.g. cloud vs non-cloud, + // so it should not be part of the validation + body.forEach((element: any) => { + if (element.hasOwnProperty('maxModelMemoryLimit')) { + delete element.maxModelMemoryLimit; + } + }); + expect(body).to.eql([ { id: 'job_id_valid',