Skip to content

Commit

Permalink
[FTR] Fix / skip flaky tests on serverless MKI (#170011)
Browse files Browse the repository at this point in the history
## Summary

This PR deals with serverless tests that are flaky when running in MKI:
* Search bar tests have been stabilized by adding a wait for global
loading before interacting with the search feature
* Summary actions API tests have been skipped for MKI runs again as the
fix didn't fully work
  • Loading branch information
pheyos committed Oct 27, 2023
1 parent 3e56a9f commit 0b81ca7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
Expand Up @@ -41,6 +41,9 @@ export default function ({ getService }: FtrProviderContext) {
const esDeleteAllIndices = getService('esDeleteAllIndices');

describe('Summary actions', function () {
// flaky on MKI, see https://github.com/elastic/kibana/issues/169204
this.tags(['failsOnMKI']);

const RULE_TYPE_ID = '.es-query';
const ALERT_ACTION_INDEX = 'alert-action-es-query';
const ALERT_INDEX = '.alerts-stack.alerts-default';
Expand Down
Expand Up @@ -8,7 +8,7 @@ import expect from '@kbn/expect';
import type { FtrProviderContext } from '../../../../ftr_provider_context';

export default function ({ getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['svlCommonPage', 'svlCommonNavigation']);
const PageObjects = getPageObjects(['header', 'svlCommonPage', 'svlCommonNavigation']);

const allLabels = [{ search: 'transform', label: 'Data / Transforms', expected: true }];
const expectedLabels = allLabels.filter((l) => l.expected);
Expand All @@ -26,6 +26,7 @@ export default function ({ getPageObjects }: FtrProviderContext) {
describe('list features', () => {
if (expectedLabels.length > 0) {
it('has the correct features enabled', async () => {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.svlCommonNavigation.search.showSearch();

for (const expectedLabel of expectedLabels) {
Expand All @@ -44,6 +45,7 @@ export default function ({ getPageObjects }: FtrProviderContext) {

if (notExpectedLabels.length > 0) {
it('has the correct features disabled', async () => {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.svlCommonNavigation.search.showSearch();

for (const notExpectedLabel of notExpectedLabels) {
Expand Down
Expand Up @@ -8,7 +8,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['svlCommonPage', 'svlCommonNavigation']);
const PageObjects = getPageObjects(['header', 'svlCommonPage', 'svlCommonNavigation']);

const allLabels = [
{ label: 'Machine Learning', expected: true },
Expand Down Expand Up @@ -49,6 +49,7 @@ export default function ({ getPageObjects }: FtrProviderContext) {

describe('list features', () => {
it('has the correct features enabled', async () => {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.svlCommonNavigation.search.showSearch();

const expectedLabels = allLabels.filter((l) => l.expected).map((l) => l.label);
Expand All @@ -64,7 +65,9 @@ export default function ({ getPageObjects }: FtrProviderContext) {
}
await PageObjects.svlCommonNavigation.search.hideSearch();
});

it('has the correct features disabled', async () => {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.svlCommonNavigation.search.showSearch();

const notExpectedLabels = allLabels.filter((l) => !l.expected).map((l) => l.label);
Expand Down
Expand Up @@ -8,7 +8,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['svlCommonPage', 'svlCommonNavigation']);
const PageObjects = getPageObjects(['header', 'svlCommonPage', 'svlCommonNavigation']);

const allLabels = [
{ label: 'Machine Learning', expected: true },
Expand Down Expand Up @@ -49,6 +49,7 @@ export default function ({ getPageObjects }: FtrProviderContext) {

describe('list features', () => {
it('has the correct features enabled', async () => {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.svlCommonNavigation.search.showSearch();

const expectedLabels = allLabels.filter((l) => l.expected).map((l) => l.label);
Expand All @@ -64,7 +65,9 @@ export default function ({ getPageObjects }: FtrProviderContext) {
}
await PageObjects.svlCommonNavigation.search.hideSearch();
});

it('has the correct features disabled', async () => {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.svlCommonNavigation.search.showSearch();

const notExpectedLabels = allLabels.filter((l) => !l.expected).map((l) => l.label);
Expand Down
Expand Up @@ -8,7 +8,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['svlCommonPage', 'svlCommonNavigation']);
const PageObjects = getPageObjects(['header', 'svlCommonPage', 'svlCommonNavigation']);

const allLabels = [
{ label: 'Machine Learning', expected: true },
Expand Down Expand Up @@ -49,6 +49,7 @@ export default function ({ getPageObjects }: FtrProviderContext) {

describe('list features', () => {
it('has the correct features enabled', async () => {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.svlCommonNavigation.search.showSearch();

const expectedLabels = allLabels.filter((l) => l.expected).map((l) => l.label);
Expand All @@ -64,7 +65,9 @@ export default function ({ getPageObjects }: FtrProviderContext) {
}
await PageObjects.svlCommonNavigation.search.hideSearch();
});

it('has the correct features disabled', async () => {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.svlCommonNavigation.search.showSearch();

const notExpectedLabels = allLabels.filter((l) => !l.expected).map((l) => l.label);
Expand Down

0 comments on commit 0b81ca7

Please sign in to comment.