Skip to content

Commit

Permalink
[Event log] Fix flaky test (#65658)
Browse files Browse the repository at this point in the history
fixes flaky test in Event Log
  • Loading branch information
gmmorris committed May 7, 2020
1 parent 50e0e2f commit 4c27798
Showing 1 changed file with 4 additions and 13 deletions.
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

0 comments on commit 4c27798

Please sign in to comment.