Skip to content

Commit

Permalink
Stabilize creation_index_pattern tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Apr 28, 2023
1 parent 2f64036 commit 55acc06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const transform = getService('transform');
const pageObjects = getPageObjects(['discover']);

// Failing: See https://github.com/elastic/kibana/issues/151889
describe.skip('creation_index_pattern', function () {
describe('creation_index_pattern', function () {
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce');
await transform.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date');
Expand All @@ -35,6 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after(async () => {
await transform.api.cleanTransformIndices();
await transform.testResources.deleteIndexPatternByTitle('ft_ecommerce');
await transform.securityUI.logout();
});

const fieldStatsEntries = [
Expand Down
15 changes: 8 additions & 7 deletions x-pack/test/functional/services/ml/field_stats_flyout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ export function MachineLearningFieldStatsFlyoutProvider({ getService }: FtrProvi
) {
const selector = `~${testSubj} > ~mlInspectFieldStatsButton-${fieldName}`;

await retry.tryForTime(2000, async () => {
await retry.tryForTime(10 * 1000, async () => {
await testSubjects.existOrFail(selector);
await testSubjects.click(selector);
await testSubjects.existOrFail('mlFieldStatsFlyout');
await testSubjects.existOrFail(`mlFieldStatsFlyoutContent ${fieldName}-title`);
await testSubjects.existOrFail('mlFieldStatsFlyout', { timeout: 500 });
await testSubjects.existOrFail(`mlFieldStatsFlyoutContent ${fieldName}-title`, {
timeout: 500,
});
});
await this.assertFieldStatContentByType(testSubj, fieldName, fieldType);
if (Array.isArray(expectedTopValuesContent)) {
Expand All @@ -89,15 +91,14 @@ export function MachineLearningFieldStatsFlyoutProvider({ getService }: FtrProvi
fieldType: 'keyword' | 'date' | 'number',
expectedTopValuesContent?: string[]
) {
await retry.tryForTime(3000, async () => {
const selector = `mlInspectFieldStatsButton-${fieldName}`;
const selector = `mlInspectFieldStatsButton-${fieldName}`;
await retry.tryForTime(20 * 1000, async () => {
const fieldTarget = await testSubjects.find(parentComboBoxSelector);
await comboBox.openOptionsList(fieldTarget);

await testSubjects.existOrFail(selector);
await testSubjects.click(selector);
await testSubjects.existOrFail('mlFieldStatsFlyout');

await testSubjects.existOrFail('mlFieldStatsFlyout', { timeout: 500 });
await testSubjects.existOrFail(`mlFieldStatsFlyoutContent ${fieldName}-title`);

await this.assertFieldStatContentByType(parentComboBoxSelector, fieldName, fieldType);
Expand Down

0 comments on commit 55acc06

Please sign in to comment.