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

[Event log] Fix flaky test #65658

Merged
merged 4 commits into from
May 7, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { merge, omit, times, chunk, isEmpty } from 'lodash';
import { merge, omit, chunk, isEmpty } from 'lodash';
import uuid from 'uuid';
import expect from '@kbn/expect/expect.js';
import moment from 'moment';
Expand All @@ -19,9 +19,7 @@ export default function({ getService }: FtrProviderContext) {
const log = getService('log');
const retry = getService('retry');

// FLAKY: https://github.com/elastic/kibana/issues/64723
// FLAKY: https://github.com/elastic/kibana/issues/64812
describe.skip('Event Log public API', () => {
describe('Event Log public API', () => {
it('should allow querying for events by Saved Object', async () => {
const id = uuid.v4();

Expand All @@ -45,11 +43,7 @@ export default function({ getService }: FtrProviderContext) {
it('should support pagination for events', async () => {
const id = uuid.v4();

const [firstExpectedEvent, ...expectedEvents] = times(6, () => fakeEvent(id));

// run one first to create the SO and avoid clashes
await logTestEvent(id, firstExpectedEvent);
await Promise.all(expectedEvents.map(event => logTestEvent(id, event)));
const expectedEvents = await logFakeEvents(id, 6);

await retry.try(async () => {
const {
Expand All @@ -59,10 +53,7 @@ export default function({ getService }: FtrProviderContext) {
expect(foundEvents.length).to.be(6);
});

const [expectedFirstPage, expectedSecondPage] = chunk(
[firstExpectedEvent, ...expectedEvents],
3
);
const [expectedFirstPage, expectedSecondPage] = chunk(expectedEvents, 3);

const {
body: { data: firstPage },
Expand Down