From 730d9337a47ed52f57fe171e57bbb55fbfb0f920 Mon Sep 17 00:00:00 2001 From: Ying Date: Mon, 26 Aug 2024 10:48:15 -0400 Subject: [PATCH] PR feedback --- .../resources/base/bin/kibana-docker | 4 +- .../task_manager/server/config.test.ts | 44 +++++++++++++--- x-pack/plugins/task_manager/server/config.ts | 34 ++++++++---- .../server/ephemeral_task_lifecycle.test.ts | 6 ++- .../managed_configuration.test.ts | 18 ++++--- .../kibana_discovery_service.test.ts | 52 ++++++++++++------- .../kibana_discovery_service.ts | 22 +++----- .../mock_kibana_discovery_service.ts | 8 +-- .../lib/calculate_health_status.test.ts | 6 ++- .../server/metrics/create_aggregator.test.ts | 6 ++- .../configuration_statistics.test.ts | 6 ++- .../task_manager/server/plugin.test.ts | 6 ++- x-pack/plugins/task_manager/server/plugin.ts | 3 +- .../server/polling_lifecycle.test.ts | 6 ++- 14 files changed, 149 insertions(+), 72 deletions(-) diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index fff9dc09ac5e1..e2ffab235f34e 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -412,10 +412,10 @@ kibana_vars=( xpack.securitySolution.packagerTaskInterval xpack.securitySolution.prebuiltRulesPackageVersion xpack.spaces.maxSpaces - xpack.task_manager.active_nodes_lookback xpack.task_manager.capacity xpack.task_manager.claim_strategy - xpack.task_manager.discovery_interval + xpack.task_manager.discovery.active_nodes_lookback + xpack.task_manager.discovery.interval xpack.task_manager.kibanas_per_partition xpack.task_manager.max_attempts xpack.task_manager.max_workers diff --git a/x-pack/plugins/task_manager/server/config.test.ts b/x-pack/plugins/task_manager/server/config.test.ts index b40ee7239fff4..fa8c18207a692 100644 --- a/x-pack/plugins/task_manager/server/config.test.ts +++ b/x-pack/plugins/task_manager/server/config.test.ts @@ -12,10 +12,12 @@ describe('config validation', () => { const config: Record = {}; expect(configSchema.validate(config)).toMatchInlineSnapshot(` Object { - "active_nodes_lookback": 30, "allow_reading_invalid_state": true, "claim_strategy": "update_by_query", - "discovery_interval": 10000, + "discovery": Object { + "active_nodes_lookback": "30s", + "interval": 10000, + }, "ephemeral_tasks": Object { "enabled": false, "request_capacity": 10, @@ -72,10 +74,12 @@ describe('config validation', () => { const config: Record = {}; expect(configSchema.validate(config)).toMatchInlineSnapshot(` Object { - "active_nodes_lookback": 30, "allow_reading_invalid_state": true, "claim_strategy": "update_by_query", - "discovery_interval": 10000, + "discovery": Object { + "active_nodes_lookback": "30s", + "interval": 10000, + }, "ephemeral_tasks": Object { "enabled": false, "request_capacity": 10, @@ -130,10 +134,12 @@ describe('config validation', () => { }; expect(configSchema.validate(config)).toMatchInlineSnapshot(` Object { - "active_nodes_lookback": 30, "allow_reading_invalid_state": true, "claim_strategy": "update_by_query", - "discovery_interval": 10000, + "discovery": Object { + "active_nodes_lookback": "30s", + "interval": 10000, + }, "ephemeral_tasks": Object { "enabled": false, "request_capacity": 10, @@ -261,4 +267,30 @@ describe('config validation', () => { const result = configSchema.validate({ claim_strategy: CLAIM_STRATEGY_MGET }); expect(result.poll_interval).toEqual(500); }); + + test('discovery active_nodes_lookback must be a valid duration', () => { + const config: Record = { + discovery: { + active_nodes_lookback: 'foo', + }, + }; + expect(() => { + configSchema.validate(config); + }).toThrowErrorMatchingInlineSnapshot( + `"[discovery.active_nodes_lookback]: active node lookback duration must be a valid duration string"` + ); + }); + + test('discovery active_nodes_lookback must be less than 5m', () => { + const config: Record = { + discovery: { + active_nodes_lookback: '301s', + }, + }; + expect(() => { + configSchema.validate(config); + }).toThrowErrorMatchingInlineSnapshot( + `"[discovery.active_nodes_lookback]: active node lookback duration cannot exceed five minutes"` + ); + }); }); diff --git a/x-pack/plugins/task_manager/server/config.ts b/x-pack/plugins/task_manager/server/config.ts index cd612edddc12a..db07494ef4f06 100644 --- a/x-pack/plugins/task_manager/server/config.ts +++ b/x-pack/plugins/task_manager/server/config.ts @@ -6,6 +6,7 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; +import { parseIntervalAsMillisecond } from './lib/intervals'; export const MAX_WORKERS_LIMIT = 100; export const DEFAULT_CAPACITY = 10; @@ -32,9 +33,12 @@ export const DEFAULT_WORKER_UTILIZATION_RUNNING_AVERAGE_WINDOW = 5; export const CLAIM_STRATEGY_UPDATE_BY_QUERY = 'update_by_query'; export const CLAIM_STRATEGY_MGET = 'mget'; -export const DEFAULT_DISCOVERY_INTERVAL_MS = 1000 * 10; +export const DEFAULT_DISCOVERY_INTERVAL_MS = 1000 * 10; // 10 seconds +const MIN_DISCOVERY_INTERVAL_MS = 1000; // 1 second +const MAX_DISCOVERY_INTERVAL_MS = 1000 * 60 * 5; // 5 minutes -export const DEFAULT_ACTIVE_NODES_LOOK_BACK_S = 30; +export const DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION = '30s'; +const FIVE_MIN_IN_MS = 5 * 60 * 1000; export const DEFAULT_KIBANAS_PER_PARTITION = 2; @@ -73,16 +77,28 @@ const requestTimeoutsConfig = schema.object({ export const configSchema = schema.object( { - active_nodes_lookback: schema.number({ - defaultValue: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, - min: 10, - }), allow_reading_invalid_state: schema.boolean({ defaultValue: true }), /* The number of normal cost tasks that this Kibana instance will run simultaneously */ capacity: schema.maybe(schema.number({ min: MIN_CAPACITY, max: MAX_CAPACITY })), - discovery_interval: schema.number({ - defaultValue: DEFAULT_DISCOVERY_INTERVAL_MS, - min: DEFAULT_DISCOVERY_INTERVAL_MS, + discovery: schema.object({ + active_nodes_lookback: schema.string({ + defaultValue: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + validate: (duration) => { + try { + const parsedDurationMs = parseIntervalAsMillisecond(duration); + if (parsedDurationMs > FIVE_MIN_IN_MS) { + return 'active node lookback duration cannot exceed five minutes'; + } + } catch (err) { + return 'active node lookback duration must be a valid duration string'; + } + }, + }), + interval: schema.number({ + defaultValue: DEFAULT_DISCOVERY_INTERVAL_MS, + min: MIN_DISCOVERY_INTERVAL_MS, + max: MAX_DISCOVERY_INTERVAL_MS, + }), }), ephemeral_tasks: schema.object({ enabled: schema.boolean({ defaultValue: false }), diff --git a/x-pack/plugins/task_manager/server/ephemeral_task_lifecycle.test.ts b/x-pack/plugins/task_manager/server/ephemeral_task_lifecycle.test.ts index 096d0ed493074..100555e9ead4c 100644 --- a/x-pack/plugins/task_manager/server/ephemeral_task_lifecycle.test.ts +++ b/x-pack/plugins/task_manager/server/ephemeral_task_lifecycle.test.ts @@ -45,8 +45,10 @@ describe('EphemeralTaskLifecycle', () => { definitions: new TaskTypeDictionary(taskManagerLogger), executionContext, config: { - active_nodes_lookback: 30, - discovery_interval: 10000, + discovery: { + active_nodes_lookback: '30s', + interval: 10000, + }, kibanas_per_partition: 2, max_attempts: 9, poll_interval: 6000000, diff --git a/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts b/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts index 84edf4f53780a..7e626c5853820 100644 --- a/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts +++ b/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts @@ -43,8 +43,10 @@ describe('managed configuration', () => { clock = sinon.useFakeTimers(); const context = coreMock.createPluginInitializerContext({ - active_nodes_lookback: 30, - discovery_interval: 10000, + discovery: { + active_nodes_lookback: '30s', + interval: 10000, + }, kibanas_per_partition: 2, capacity: 10, max_attempts: 9, @@ -163,8 +165,10 @@ describe('managed configuration', () => { clock = sinon.useFakeTimers(); const context = coreMock.createPluginInitializerContext({ - active_nodes_lookback: 30, - discovery_interval: 10000, + discovery: { + active_nodes_lookback: '30s', + interval: 10000, + }, kibanas_per_partition: 2, capacity: 10, max_attempts: 9, @@ -286,8 +290,10 @@ describe('managed configuration', () => { clock = sinon.useFakeTimers(); const context = coreMock.createPluginInitializerContext({ - active_nodes_lookback: 30, - discovery_interval: 10000, + discovery: { + active_nodes_lookback: '30s', + interval: 10000, + }, kibanas_per_partition: 2, capacity: 10, max_attempts: 9, diff --git a/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.test.ts b/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.test.ts index 0b26270dfa4bb..cbfd7f8dc760f 100644 --- a/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.test.ts +++ b/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.test.ts @@ -10,7 +10,7 @@ import { BACKGROUND_TASK_NODE_SO_NAME } from '../saved_objects'; import { SavedObjectsBulkDeleteResponse, SavedObjectsUpdateResponse } from '@kbn/core/server'; import { createFindResponse, createFindSO } from './mock_kibana_discovery_service'; -import { DEFAULT_ACTIVE_NODES_LOOK_BACK_S, DEFAULT_DISCOVERY_INTERVAL_MS } from '../config'; +import { DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, DEFAULT_DISCOVERY_INTERVAL_MS } from '../config'; const currentNode = 'current-node-id'; const now = '2024-08-10T10:00:00.000Z'; @@ -40,8 +40,10 @@ describe('KibanaDiscoveryService', () => { savedObjectsRepository, logger, currentNode, - discoveryInterval: DEFAULT_DISCOVERY_INTERVAL_MS, - activeNodesLookBack: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, }); await kibanaDiscoveryService.start(); @@ -67,8 +69,10 @@ describe('KibanaDiscoveryService', () => { savedObjectsRepository, logger, currentNode, - discoveryInterval: DEFAULT_DISCOVERY_INTERVAL_MS, - activeNodesLookBack: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, }); await kibanaDiscoveryService.start(); await kibanaDiscoveryService.start(); @@ -85,8 +89,10 @@ describe('KibanaDiscoveryService', () => { savedObjectsRepository, logger, currentNode, - discoveryInterval: DEFAULT_DISCOVERY_INTERVAL_MS, - activeNodesLookBack: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, }); await kibanaDiscoveryService.start(); @@ -111,8 +117,10 @@ describe('KibanaDiscoveryService', () => { savedObjectsRepository, logger, currentNode, - discoveryInterval: DEFAULT_DISCOVERY_INTERVAL_MS, - activeNodesLookBack: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, }); await kibanaDiscoveryService.start(); @@ -138,8 +146,10 @@ describe('KibanaDiscoveryService', () => { savedObjectsRepository, logger, currentNode, - discoveryInterval: DEFAULT_DISCOVERY_INTERVAL_MS, - activeNodesLookBack: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, }); await kibanaDiscoveryService.start(); @@ -181,14 +191,16 @@ describe('KibanaDiscoveryService', () => { savedObjectsRepository, logger, currentNode, - discoveryInterval: DEFAULT_DISCOVERY_INTERVAL_MS, - activeNodesLookBack: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, }); const activeNodes = await kibanaDiscoveryService.getActiveKibanaNodes(); expect(savedObjectsRepository.find).toHaveBeenCalledWith({ - filter: `${BACKGROUND_TASK_NODE_SO_NAME}.attributes.last_seen > now-${DEFAULT_ACTIVE_NODES_LOOK_BACK_S}s`, + filter: `${BACKGROUND_TASK_NODE_SO_NAME}.attributes.last_seen > now-${DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION}`, page: 1, perPage: 10000, type: BACKGROUND_TASK_NODE_SO_NAME, @@ -205,8 +217,10 @@ describe('KibanaDiscoveryService', () => { savedObjectsRepository, logger, currentNode, - discoveryInterval: DEFAULT_DISCOVERY_INTERVAL_MS, - activeNodesLookBack: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, }); await kibanaDiscoveryService.deleteCurrentNode(); @@ -228,8 +242,10 @@ describe('KibanaDiscoveryService', () => { savedObjectsRepository, logger, currentNode, - discoveryInterval: DEFAULT_DISCOVERY_INTERVAL_MS, - activeNodesLookBack: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, }); await kibanaDiscoveryService.deleteCurrentNode(); diff --git a/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.ts b/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.ts index 92d4a5bfb03e1..b6802a5428bc4 100644 --- a/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.ts +++ b/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.ts @@ -9,11 +9,11 @@ import type { ISavedObjectsRepository } from '@kbn/core/server'; import { Logger } from '@kbn/core/server'; import { BACKGROUND_TASK_NODE_SO_NAME } from '../saved_objects'; import { BackgroundTaskNode } from '../saved_objects/schemas/background_task_node'; +import { TaskManagerConfig } from '../config'; interface DiscoveryServiceParams { - activeNodesLookBack: number; + config: TaskManagerConfig['discovery']; currentNode: string; - discoveryInterval: number; savedObjectsRepository: ISavedObjectsRepository; logger: Logger; } @@ -24,22 +24,16 @@ interface DiscoveryServiceUpsertParams { } export class KibanaDiscoveryService { - private activeNodesLookBack: number; + private readonly activeNodesLookBack: string; + private readonly discoveryInterval: number; private currentNode: string; - private discoveryInterval: number; private started = false; private savedObjectsRepository: ISavedObjectsRepository; private logger: Logger; - constructor({ - activeNodesLookBack, - currentNode, - discoveryInterval, - savedObjectsRepository, - logger, - }: DiscoveryServiceParams) { - this.activeNodesLookBack = activeNodesLookBack; - this.discoveryInterval = discoveryInterval; + constructor({ config, currentNode, savedObjectsRepository, logger }: DiscoveryServiceParams) { + this.activeNodesLookBack = config.active_nodes_lookback; + this.discoveryInterval = config.interval; this.savedObjectsRepository = savedObjectsRepository; this.logger = logger; this.currentNode = currentNode; @@ -102,7 +96,7 @@ export class KibanaDiscoveryService { type: BACKGROUND_TASK_NODE_SO_NAME, perPage: 10000, page: 1, - filter: `${BACKGROUND_TASK_NODE_SO_NAME}.attributes.last_seen > now-${this.activeNodesLookBack}s`, + filter: `${BACKGROUND_TASK_NODE_SO_NAME}.attributes.last_seen > now-${this.activeNodesLookBack}`, }); return activeNodes; diff --git a/x-pack/plugins/task_manager/server/kibana_discovery_service/mock_kibana_discovery_service.ts b/x-pack/plugins/task_manager/server/kibana_discovery_service/mock_kibana_discovery_service.ts index 477b7475b9feb..eb5956c6c5173 100644 --- a/x-pack/plugins/task_manager/server/kibana_discovery_service/mock_kibana_discovery_service.ts +++ b/x-pack/plugins/task_manager/server/kibana_discovery_service/mock_kibana_discovery_service.ts @@ -10,7 +10,7 @@ import { SavedObjectsFindResponse, SavedObjectsFindResult } from '@kbn/core/serv import { BackgroundTaskNode } from '../saved_objects/schemas/background_task_node'; import { BACKGROUND_TASK_NODE_SO_NAME } from '../saved_objects'; import { KibanaDiscoveryService } from './kibana_discovery_service'; -import { DEFAULT_ACTIVE_NODES_LOOK_BACK_S, DEFAULT_DISCOVERY_INTERVAL_MS } from '../config'; +import { DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, DEFAULT_DISCOVERY_INTERVAL_MS } from '../config'; export const createDiscoveryServiceMock = (currentNode: string) => { const savedObjectsRepository = savedObjectsRepositoryMock.create(); @@ -19,8 +19,10 @@ export const createDiscoveryServiceMock = (currentNode: string) => { savedObjectsRepository, logger, currentNode, - activeNodesLookBack: DEFAULT_ACTIVE_NODES_LOOK_BACK_S, - discoveryInterval: DEFAULT_DISCOVERY_INTERVAL_MS, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, }); for (const method of ['getActiveKibanaNodes'] as Array) { diff --git a/x-pack/plugins/task_manager/server/lib/calculate_health_status.test.ts b/x-pack/plugins/task_manager/server/lib/calculate_health_status.test.ts index c9f26ebdea2cd..3943e94bdb8b3 100644 --- a/x-pack/plugins/task_manager/server/lib/calculate_health_status.test.ts +++ b/x-pack/plugins/task_manager/server/lib/calculate_health_status.test.ts @@ -15,8 +15,10 @@ Date.now = jest.fn().mockReturnValue(new Date(now)); const logger = loggingSystemMock.create().get(); const config = { - active_nodes_lookback: 30, - discovery_interval: 10000, + discovery: { + active_nodes_lookback: '30s', + interval: 10000, + }, kibanas_per_partition: 2, enabled: true, index: 'foo', diff --git a/x-pack/plugins/task_manager/server/metrics/create_aggregator.test.ts b/x-pack/plugins/task_manager/server/metrics/create_aggregator.test.ts index 407bafb9ecd34..b39e1b3168731 100644 --- a/x-pack/plugins/task_manager/server/metrics/create_aggregator.test.ts +++ b/x-pack/plugins/task_manager/server/metrics/create_aggregator.test.ts @@ -35,8 +35,10 @@ import { TaskOverdueMetric, TaskOverdueMetricsAggregator } from './task_overdue_ const logger = loggingSystemMock.createLogger(); const mockMetricsAggregator = metricsAggregatorMock.create(); const config: TaskManagerConfig = { - active_nodes_lookback: 30, - discovery_interval: 10000, + discovery: { + active_nodes_lookback: '30s', + interval: 10000, + }, kibanas_per_partition: 2, allow_reading_invalid_state: false, ephemeral_tasks: { diff --git a/x-pack/plugins/task_manager/server/monitoring/configuration_statistics.test.ts b/x-pack/plugins/task_manager/server/monitoring/configuration_statistics.test.ts index 0b8722ecfcec5..a169c9dad8fe5 100644 --- a/x-pack/plugins/task_manager/server/monitoring/configuration_statistics.test.ts +++ b/x-pack/plugins/task_manager/server/monitoring/configuration_statistics.test.ts @@ -13,8 +13,10 @@ import { TaskManagerConfig } from '../config'; describe('Configuration Statistics Aggregator', () => { test('merges the static config with the merged configs', async () => { const configuration: TaskManagerConfig = { - active_nodes_lookback: 30, - discovery_interval: 10000, + discovery: { + active_nodes_lookback: '30s', + interval: 10000, + }, kibanas_per_partition: 2, max_attempts: 9, poll_interval: 6000000, diff --git a/x-pack/plugins/task_manager/server/plugin.test.ts b/x-pack/plugins/task_manager/server/plugin.test.ts index 31969c20ce396..408c20abb10de 100644 --- a/x-pack/plugins/task_manager/server/plugin.test.ts +++ b/x-pack/plugins/task_manager/server/plugin.test.ts @@ -44,8 +44,10 @@ const pluginInitializerContextParams = { version_conflict_threshold: 80, request_capacity: 1000, allow_reading_invalid_state: false, - active_nodes_lookback: 30, - discovery_interval: 10000, + discovery: { + active_nodes_lookback: '30s', + interval: 10000, + }, kibanas_per_partition: 2, monitored_aggregated_stats_refresh_rate: 5000, monitored_stats_health_verbose_log: { diff --git a/x-pack/plugins/task_manager/server/plugin.ts b/x-pack/plugins/task_manager/server/plugin.ts index ea29ba02fc433..71899361ea059 100644 --- a/x-pack/plugins/task_manager/server/plugin.ts +++ b/x-pack/plugins/task_manager/server/plugin.ts @@ -259,8 +259,7 @@ export class TaskManagerPlugin savedObjectsRepository, logger: this.logger, currentNode: this.taskManagerId!, - discoveryInterval: this.config.discovery_interval, - activeNodesLookBack: this.config.active_nodes_lookback, + config: this.config.discovery, }); if (this.shouldRunBackgroundTasks) { diff --git a/x-pack/plugins/task_manager/server/polling_lifecycle.test.ts b/x-pack/plugins/task_manager/server/polling_lifecycle.test.ts index 658f8caeb1d08..db1e5277ce37f 100644 --- a/x-pack/plugins/task_manager/server/polling_lifecycle.test.ts +++ b/x-pack/plugins/task_manager/server/polling_lifecycle.test.ts @@ -45,8 +45,10 @@ describe('TaskPollingLifecycle', () => { const mockTaskStore = taskStoreMock.create({}); const taskManagerOpts = { config: { - active_nodes_lookback: 30, - discovery_interval: 10000, + discovery: { + active_nodes_lookback: '30s', + interval: 10000, + }, kibanas_per_partition: 2, enabled: true, index: 'foo',