From 37c4758f8f51ba5cdcff1deef217073228f63b6d Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Thu, 12 Mar 2020 14:45:20 +0100 Subject: [PATCH] [ML] Functional tests - stabilize date_nanos test (#59986) This PR stabilizes the date_nanos test by adding a retry to the dedicated index switch click. --- .../anomaly_detection/date_nanos_job.ts | 3 +-- .../services/machine_learning/job_wizard_common.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/date_nanos_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/date_nanos_job.ts index 880a268bba794..2a9824f46778d 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/date_nanos_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/date_nanos_job.ts @@ -165,8 +165,7 @@ export default function({ getService }: FtrProviderContext) { }, ]; - // FLAKY: https://github.com/elastic/kibana/issues/59419 - describe.skip('job on data set with date_nanos time field', function() { + describe('job on data set with date_nanos time field', function() { this.tags(['smoke', 'mlqa']); before(async () => { await esArchiver.load('ml/event_rate_nanos'); diff --git a/x-pack/test/functional/services/machine_learning/job_wizard_common.ts b/x-pack/test/functional/services/machine_learning/job_wizard_common.ts index 38e6694669c1a..70d576a3d847b 100644 --- a/x-pack/test/functional/services/machine_learning/job_wizard_common.ts +++ b/x-pack/test/functional/services/machine_learning/job_wizard_common.ts @@ -280,11 +280,13 @@ export function MachineLearningJobWizardCommonProvider( withAdvancedSection: sectionOptions.withAdvancedSection, })) === false ) { - await testSubjects.clickWhenNotDisabled(subj); + await retry.tryForTime(5 * 1000, async () => { + await testSubjects.clickWhenNotDisabled(subj); + await this.assertDedicatedIndexSwitchCheckedState(true, { + withAdvancedSection: sectionOptions.withAdvancedSection, + }); + }); } - await this.assertDedicatedIndexSwitchCheckedState(true, { - withAdvancedSection: sectionOptions.withAdvancedSection, - }); }, async assertModelMemoryLimitInputExists(