From d21d94109256b098484ee7458bc86bc7c5fb9589 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 27 Sep 2021 11:53:45 -0400 Subject: [PATCH] [ML] Functional tests - stabilize custom URLs tests (#113096) (#113112) This PR stabilizes the functional custom URLs tests by adding retries for the dashboard and other type URL save service methods, similar to what we already have in the discover type URL save service method. Co-authored-by: Robert Oskamp --- x-pack/test/functional/services/ml/job_table.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/x-pack/test/functional/services/ml/job_table.ts b/x-pack/test/functional/services/ml/job_table.ts index 4a38aa4efe4dd..e1a675d760f2e 100644 --- a/x-pack/test/functional/services/ml/job_table.ts +++ b/x-pack/test/functional/services/ml/job_table.ts @@ -634,9 +634,11 @@ export function MachineLearningJobTableProvider( } // Save custom URL - await testSubjects.click('mlJobAddCustomUrl'); - const expectedIndex = existingCustomUrls.length; - await customUrls.assertCustomUrlLabel(expectedIndex, customUrl.label); + await retry.tryForTime(5000, async () => { + await testSubjects.click('mlJobAddCustomUrl'); + const expectedIndex = existingCustomUrls.length; + await customUrls.assertCustomUrlLabel(expectedIndex, customUrl.label); + }); // Save the job await this.saveEditJobFlyoutChanges(); @@ -654,9 +656,11 @@ export function MachineLearningJobTableProvider( await customUrls.setCustomUrlOtherTypeUrl(customUrl.url); // Save custom URL - await testSubjects.click('mlJobAddCustomUrl'); - const expectedIndex = existingCustomUrls.length; - await customUrls.assertCustomUrlLabel(expectedIndex, customUrl.label); + await retry.tryForTime(5000, async () => { + await testSubjects.click('mlJobAddCustomUrl'); + const expectedIndex = existingCustomUrls.length; + await customUrls.assertCustomUrlLabel(expectedIndex, customUrl.label); + }); // Save the job await this.saveEditJobFlyoutChanges();