diff --git a/x-pack/plugins/event_log/server/es/context.test.ts b/x-pack/plugins/event_log/server/es/context.test.ts index 21ff4eac38f68..09fe676a5762e 100644 --- a/x-pack/plugins/event_log/server/es/context.test.ts +++ b/x-pack/plugins/event_log/server/es/context.test.ts @@ -7,7 +7,9 @@ import { createEsContext } from './context'; import { ClusterClient, Logger } from '../../../../../src/core/server'; import { elasticsearchServiceMock, loggingServiceMock } from '../../../../../src/core/server/mocks'; - +jest.mock('../lib/../../../../package.json', () => ({ + version: '1.2.3', +})); type EsClusterClient = Pick, 'callAsInternalUser' | 'asScoped'>; let logger: Logger; @@ -42,12 +44,12 @@ describe('createEsContext', () => { const esNames = context.esNames; expect(esNames).toStrictEqual({ base: 'test-index', - alias: 'test-index-event-log-8.0.0', + alias: 'test-index-event-log-1.2.3', ilmPolicy: 'test-index-event-log-policy', indexPattern: 'test-index-event-log-*', - indexPatternWithVersion: 'test-index-event-log-8.0.0-*', - indexTemplate: 'test-index-event-log-8.0.0-template', - initialIndex: 'test-index-event-log-8.0.0-000001', + indexPatternWithVersion: 'test-index-event-log-1.2.3-*', + indexTemplate: 'test-index-event-log-1.2.3-template', + initialIndex: 'test-index-event-log-1.2.3-000001', }); }); diff --git a/x-pack/test/plugin_api_integration/test_suites/event_log/service_api_integration.ts b/x-pack/test/plugin_api_integration/test_suites/event_log/service_api_integration.ts index 237258bc14376..86df2d1e31fd8 100644 --- a/x-pack/test/plugin_api_integration/test_suites/event_log/service_api_integration.ts +++ b/x-pack/test/plugin_api_integration/test_suites/event_log/service_api_integration.ts @@ -38,7 +38,7 @@ export default function({ getService }: FtrProviderContext) { .get('kbnTestServer.serverArgs') .find((val: string) => val === '--xpack.eventLog.indexEntries=true'); const result = await isIndexingEntries(); - const exists = await es.indices.exists({ index: '.kibana-event-log-8.0.0-000001' }); + const exists = await es.indices.exists({ index: '.kibana-event-log-*' }); expect(exists).to.be.eql(true); expect(configValue).to.be.eql( `--xpack.eventLog.indexEntries=${result.body.isIndexingEntries}` @@ -105,7 +105,9 @@ export default function({ getService }: FtrProviderContext) { kibana: { saved_objects: [{ type: 'event_log_test', id: eventId }] }, }; await startTimingEventLogger(event); - setTimeout(() => log.debug('doing some action'), 500); + retry.try(async () => { + Promise.resolve(log.debug('doing some action')); + }); await stopTimingEventLogger(event); await logTestEvent(eventId, event); @@ -133,7 +135,9 @@ export default function({ getService }: FtrProviderContext) { kibana: { saved_objects: [{ type: 'action', id: eventId }] }, }; await startTimingEventLogger(event); - setTimeout(() => log.debug('doing some action'), 500); + retry.try(async () => { + Promise.resolve(log.debug('doing some action')); + }); await stopTimingEventLogger(event); await logTestEvent(eventId, event);