From 0b3391a8fd087960e741c615b2d433811fb99d67 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Tue, 9 Jun 2020 11:28:43 +0200 Subject: [PATCH] [ML] Functional tests - fix job validation API test with maxModelMemoryLimit (#68501) 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 55497940190c..fc8f83774422 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',