From f7f2988aa2d6a557ee2aa6aa184ea774bb57f345 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Mon, 10 Aug 2020 13:04:57 +0200 Subject: [PATCH] [ML] Functional tests - stabilize DFA job type check (#74631) This PR stabilizes the data frame analytics job type assertion by adding a retry. --- .../ml/data_frame_analytics_creation.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts b/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts index a49febfe68f61..d8df2fb869ed7 100644 --- a/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts +++ b/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts @@ -46,14 +46,16 @@ export function MachineLearningDataFrameAnalyticsCreationProvider( }, async assertJobTypeSelection(expectedSelection: string) { - const actualSelection = await testSubjects.getAttribute( - 'mlAnalyticsCreateJobWizardJobTypeSelect', - 'value' - ); - expect(actualSelection).to.eql( - expectedSelection, - `Job type selection should be '${expectedSelection}' (got '${actualSelection}')` - ); + await retry.tryForTime(5000, async () => { + const actualSelection = await testSubjects.getAttribute( + 'mlAnalyticsCreateJobWizardJobTypeSelect', + 'value' + ); + expect(actualSelection).to.eql( + expectedSelection, + `Job type selection should be '${expectedSelection}' (got '${actualSelection}')` + ); + }); }, async selectJobType(jobType: string) {