Skip to content

Commit

Permalink
[ML] Fix anomaly detection test suite (#51712)
Browse files Browse the repository at this point in the history
This PR re-enables the anomaly detection test suite and disables Firefox test execution for now. It also increases stability for `clickEditDetector` and removes unneeded retries.
  • Loading branch information
pheyos committed Dec 3, 2019
1 parent ac66b90 commit d0eb714
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function({ loadTestFile }: FtrProviderContext) {
// FLAKY: https://github.com/elastic/kibana/issues/51669
describe.skip('anomaly detection', function() {
describe('anomaly detection', function() {
this.tags(['skipFirefox']);

loadTestFile(require.resolve('./single_metric_job'));
loadTestFile(require.resolve('./multi_metric_job'));
loadTestFile(require.resolve('./population_job'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export function MachineLearningJobManagementProvider(
mlApi: ProvidedType<typeof MachineLearningAPIProvider>
) {
const testSubjects = getService('testSubjects');
const retry = getService('retry');

return {
async navigateToNewJobSourceSelection() {
Expand All @@ -36,10 +35,7 @@ export function MachineLearningJobManagementProvider(
},

async assertStartDatafeedModalExists() {
// this retry can be removed as soon as #48734 is merged
await retry.tryForTime(5000, async () => {
await testSubjects.existOrFail('mlStartDatafeedModal');
});
await testSubjects.existOrFail('mlStartDatafeedModal', { timeout: 5000 });
},

async confirmStartDatafeedModal() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,7 @@ export function MachineLearningJobWizardAdvancedProvider({
},

async assertCreateDetectorModalExists() {
// this retry can be removed as soon as #48734 is merged
await retry.tryForTime(5000, async () => {
await testSubjects.existOrFail('mlCreateDetectorModal');
});
await testSubjects.existOrFail('mlCreateDetectorModal', { timeout: 5000 });
},

async assertDetectorFunctionInputExists() {
Expand Down Expand Up @@ -298,18 +295,17 @@ export function MachineLearningJobWizardAdvancedProvider({
},

async clickEditDetector(detectorIndex: number) {
await testSubjects.click(
`mlAdvancedDetector ${detectorIndex} > mlAdvancedDetectorEditButton`
);
await this.assertCreateDetectorModalExists();
await retry.tryForTime(20 * 1000, async () => {
await testSubjects.click(
`mlAdvancedDetector ${detectorIndex} > mlAdvancedDetectorEditButton`
);
await this.assertCreateDetectorModalExists();
});
},

async createJob() {
await testSubjects.clickWhenNotDisabled('mlJobWizardButtonCreateJob');
// this retry can be removed as soon as #48734 is merged
await retry.tryForTime(5000, async () => {
await testSubjects.existOrFail('mlStartDatafeedModal');
});
await testSubjects.existOrFail('mlStartDatafeedModal', { timeout: 10 * 1000 });
},
};
}

0 comments on commit d0eb714

Please sign in to comment.