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

Fix flaky SO import tests #97586

Merged
Merged
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
9 changes: 4 additions & 5 deletions test/functional/apps/management/_import_objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { keyBy } from 'lodash';
import { FtrProviderContext } from '../../ftr_provider_context';

const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

function uniq<T>(input: T[]): T[] {
return [...new Set(input)];
}
Expand All @@ -23,9 +24,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const log = getService('log');

// FLAKY: https://github.com/elastic/kibana/issues/95660
// FLAKY: https://github.com/elastic/kibana/issues/95706
describe.skip('import objects', function describeIndexTests() {
describe('import objects', function describeIndexTests() {
describe('.ndjson file', () => {
beforeEach(async function () {
await esArchiver.load('management');
Expand Down Expand Up @@ -314,7 +313,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
// but as the initial popin can take a few ms before fading, we need to wait a little
// to avoid clicking twice on the same modal.
await delay(1000);
await PageObjects.common.clickConfirmOnModal(false);
await PageObjects.common.clickConfirmOnModal(true);

const isSuccessful = await testSubjects.exists('importSavedObjectsSuccess');
expect(isSuccessful).to.be(true);
Expand All @@ -335,7 +334,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
// but as the initial popin can take a few ms before fading, we need to wait a little
// to avoid clicking twice on the same modal.
await delay(1000);
await PageObjects.common.clickConfirmOnModal(false);
await PageObjects.common.clickConfirmOnModal(true);
Comment on lines -338 to +337
Copy link
Contributor Author

@pgayvallet pgayvallet Apr 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what was causing the flakiness.

When adding the tests in FTR tests in #76482, I had to add a manual delay between the first and second modal because the second one is appearing directly, so we can't rely on the ensureHidden option of clickConfirmOnModal. However I forgot to properly await the modal to close after the second click.


const isSuccessful = await testSubjects.exists('importSavedObjectsSuccess');
expect(isSuccessful).to.be(true);
Expand Down