Skip to content

Commit

Permalink
[ML] Functional tests - stabilize custom URLs tests (#113096) (#113112)
Browse files Browse the repository at this point in the history
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 <robert.oskamp@elastic.co>
  • Loading branch information
kibanamachine and pheyos authored Sep 27, 2021
1 parent b409e2e commit d21d941
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions x-pack/test/functional/services/ml/job_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit d21d941

Please sign in to comment.