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] Functional tests - stabilize and re-enable test suites #144784

Merged
merged 6 commits into from
Nov 10, 2022
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 @@ -36,9 +36,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await dashboardPanelActions.openContextMenuMorePanel(header);
}

// Failing: See https://github.com/elastic/kibana/issues/142762
describe.skip('create jobs from lens', function () {
describe('create jobs from lens', function () {
this.tags(['ml']);
let jobId: string;

before(async () => {
await ml.testResources.setKibanaTimeZoneToUTC();
Expand All @@ -58,9 +58,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.common.navigateToApp('dashboard');
});

afterEach(async () => {
await ml.api.deleteAnomalyDetectionJobES(jobId);
});

it('can create a single metric job from vis with single layer', async () => {
const selectedPanelTitle = 'panel2';
const jobId = 'job_from_lens_1';
jobId = 'job_from_lens_1';
const numberOfCompatibleLayers = 1;
const layerIndex = 0;

Expand Down Expand Up @@ -88,13 +92,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await ml.jobSelection.assertJobSelection([jobId]);

await ml.api.assertModelMemoryLimitForJob(jobId, '11mb');

await ml.api.deleteAnomalyDetectionJobES(jobId);
});

it('can create multi metric job from vis with single layer', async () => {
const selectedPanelTitle = 'panel1';
const jobId = 'job_from_lens_2';
jobId = 'job_from_lens_2';
const numberOfCompatibleLayers = 1;
const layerIndex = 0;

Expand Down Expand Up @@ -122,8 +124,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await ml.jobSelection.assertJobSelection([jobId]);

await ml.api.assertModelMemoryLimitForJob(jobId, '12mb');

await ml.api.deleteAnomalyDetectionJobES(jobId);
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ export default function ({ getService, getPageObject, getPageObjects }: FtrProvi
await ml.jobTable.assertJobRowJobId(jobId);
}

// Failing: See https://github.com/elastic/kibana/issues/144186
describe.skip('create jobs from lens with wizard', function () {
describe('create jobs from lens with wizard', function () {
this.tags(['ml']);

before(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export default function ({ getService }: FtrProviderContext) {
const ml = getService('ml');
const browser = getService('browser');

// Failing: See https://github.com/elastic/kibana/issues/143933
describe.skip('custom urls', function () {
describe('custom urls', function () {
this.tags(['ml']);

let testDashboardId: string | null = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ export default function ({ getService }: FtrProviderContext) {
await ml.dataVisualizerIndexBased.assertTotalFieldsCount(testData.expected.totalFieldsCount);
}

// FLAKY: https://github.com/elastic/kibana/issues/143007
describe.skip('data view management', function () {
describe('data view management', function () {
this.tags(['ml']);
const indexPatternTitle = 'ft_farequote';
before(async () => {
Expand Down
3 changes: 1 addition & 2 deletions x-pack/test/functional/apps/ml/short_tests/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const ml = getService('ml');

// FLAKY: https://github.com/elastic/kibana/issues/142397
describe.skip('page navigation', function () {
describe('page navigation', function () {
this.tags(['skipFirefox', 'ml']);
before(async () => {
await ml.api.cleanMlIndices();
Expand Down
3 changes: 3 additions & 0 deletions x-pack/test/functional/services/ml/custom_urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,15 @@ export function MachineLearningCustomUrlsProvider({

async assertDiscoverCustomUrlAction(expectedHitCountFormatted: string) {
await PageObjects.discover.waitForDiscoverAppOnScreen();
await PageObjects.header.waitUntilLoadingHasFinished();

// Make sure all existing popovers are closed
await browser.pressKeys(browser.keys.ESCAPE);

// During cloud tests, the small browser width might cause hit count to be invisible
// so temporarily collapsing the sidebar ensures the count shows
await PageObjects.discover.closeSidebar();

await retry.tryForTime(10 * 1000, async () => {
const hitCount = await PageObjects.discover.getHitCount();
expect(hitCount).to.eql(
Expand Down
25 changes: 13 additions & 12 deletions x-pack/test/functional/services/ml/data_visualizer_index_based.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export function MachineLearningDataVisualizerIndexBasedProvider({
const filterBar = getService('filterBar');
const browser = getService('browser');

type RandomSamplerOption =
| 'dvRandomSamplerOptionOnAutomatic'
| 'dvRandomSamplerOptionOnManual'
| 'dvRandomSamplerOptionOff';

return {
async assertTimeRangeSelectorSectionExists() {
await testSubjects.existOrFail('dataVisualizerTimeRangeSelectorSection');
Expand All @@ -34,11 +39,15 @@ export function MachineLearningDataVisualizerIndexBasedProvider({
});
},

async clickUseFullDataButton(expectedFormattedTotalDocCount: string) {
async clickUseFullDataButton(
expectedFormattedTotalDocCount: string,
randomSamplerOption: RandomSamplerOption = 'dvRandomSamplerOptionOff'
) {
await retry.tryForTime(30 * 1000, async () => {
await testSubjects.clickWhenNotDisabledWithoutRetry('dataVisualizerButtonUseFullData');
await testSubjects.clickWhenNotDisabledWithoutRetry('superDatePickerApplyTimeButton');
await this.assertTotalDocumentCount(expectedFormattedTotalDocCount);
await this.setRandomSamplingOption(randomSamplerOption);
await await this.assertTotalDocumentCount(expectedFormattedTotalDocCount);
});
},

Expand Down Expand Up @@ -238,10 +247,7 @@ export function MachineLearningDataVisualizerIndexBasedProvider({
},

async assertRandomSamplingOption(
expectedOption:
| 'dvRandomSamplerOptionOnAutomatic'
| 'dvRandomSamplerOptionOnManual'
| 'dvRandomSamplerOptionOff',
expectedOption: RandomSamplerOption,
expectedProbability?: number
) {
await retry.tryForTime(20000, async () => {
Expand Down Expand Up @@ -291,12 +297,7 @@ export function MachineLearningDataVisualizerIndexBasedProvider({
});
},

async setRandomSamplingOption(
option:
| 'dvRandomSamplerOptionOnAutomatic'
| 'dvRandomSamplerOptionOnManual'
| 'dvRandomSamplerOptionOff'
) {
async setRandomSamplingOption(option: RandomSamplerOption) {
await retry.tryForTime(20000, async () => {
// escape popover
await browser.pressKeys(browser.keys.ESCAPE);
Expand Down