Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Fix anomaly detection test suite #51712

Merged
merged 4 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 });
},
};
}