Skip to content

Commit

Permalink
Flaky #111821 - Refresh index (#199136)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Nov 6, 2024
1 parent be3c159 commit 8054aa2
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
*/

import moment, { type MomentInput } from 'moment';
import type { Logger, ISavedObjectsRepository, SavedObject } from '@kbn/core/server';
import type {
Logger,
ISavedObjectsRepository,
SavedObject,
ElasticsearchClient,
} from '@kbn/core/server';
import {
type TestElasticsearchUtils,
type TestKibanaUtils,
Expand Down Expand Up @@ -72,11 +77,11 @@ function createRawEventLoopDelaysDailyDocs() {
return { rawEventLoopDelaysDaily, outdatedRawEventLoopDelaysDaily };
}

// Failing: See https://github.com/elastic/kibana/issues/111821
describe.skip(`daily rollups integration test`, () => {
describe(`daily rollups integration test`, () => {
let esServer: TestElasticsearchUtils;
let root: TestKibanaUtils['root'];
let internalRepository: ISavedObjectsRepository;
let esClient: ElasticsearchClient;
let logger: Logger;
let rawEventLoopDelaysDaily: Array<SavedObject<EventLoopDelaysDaily>>;
let outdatedRawEventLoopDelaysDaily: Array<SavedObject<EventLoopDelaysDaily>>;
Expand All @@ -94,6 +99,7 @@ describe.skip(`daily rollups integration test`, () => {
const start = await root.start();
logger = root.logger.get('test daily rollups');
internalRepository = start.savedObjects.createInternalRepository([SAVED_OBJECTS_DAILY_TYPE]);
esClient = start.elasticsearch.client.asInternalUser;

// Create the docs now
const rawDailyDocs = createRawEventLoopDelaysDailyDocs();
Expand All @@ -113,6 +119,7 @@ describe.skip(`daily rollups integration test`, () => {

it('deletes documents older that 3 days from the saved objects repository', async () => {
await rollDailyData(logger, internalRepository);
await esClient.indices.refresh({ index: `.kibana` }); // Make sure that the changes are searchable
const { total, saved_objects: savedObjects } =
await internalRepository.find<EventLoopDelaysDaily>({ type: SAVED_OBJECTS_DAILY_TYPE });
expect(total).toBe(rawEventLoopDelaysDaily.length);
Expand Down

0 comments on commit 8054aa2

Please sign in to comment.