From 3b98c57dd383edf8dbd592ee37b10c9ae9cf806e Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Mon, 26 Aug 2024 13:07:23 +0200 Subject: [PATCH] rename arg in retry service to testFn --- x-pack/test/alerting_api_integration/common/retry.ts | 9 ++++----- .../observability/helpers/alerting_wait_for_helpers.ts | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/x-pack/test/alerting_api_integration/common/retry.ts b/x-pack/test/alerting_api_integration/common/retry.ts index dbb1c886f6249..1f5df66995197 100644 --- a/x-pack/test/alerting_api_integration/common/retry.ts +++ b/x-pack/test/alerting_api_integration/common/retry.ts @@ -19,7 +19,7 @@ import type { ToolingLog } from '@kbn/tooling-log'; * Example usage: * ```ts const fleetResponse = await retry({ - test: async () => { + testFn: async () => { const testResponse = await supertest .post(`/api/fleet/epm/packages/security_detection_engine`) .set('kbn-xsrf', 'xxxx') @@ -45,7 +45,7 @@ import type { ToolingLog } from '@kbn/tooling-log'; * @returns The response from the test */ export const retry = async ({ - test, + testFn, retryService, utilityName, retries = 3, @@ -53,7 +53,7 @@ export const retry = async ({ retryDelay = 200, logger, }: { - test: () => Promise; + testFn: () => Promise; utilityName: string; retryService: RetryService; retries?: number; @@ -77,8 +77,7 @@ export const retry = async ({ retryAttempt = retryAttempt + 1; - // eslint-disable-next-line mocha/no-empty-description - return await test(); + return await testFn(); }, undefined, retryDelay diff --git a/x-pack/test/alerting_api_integration/observability/helpers/alerting_wait_for_helpers.ts b/x-pack/test/alerting_api_integration/observability/helpers/alerting_wait_for_helpers.ts index 861c59dbf2b7a..17f45b8129d91 100644 --- a/x-pack/test/alerting_api_integration/observability/helpers/alerting_wait_for_helpers.ts +++ b/x-pack/test/alerting_api_integration/observability/helpers/alerting_wait_for_helpers.ts @@ -34,7 +34,7 @@ export async function waitForRuleStatus({ logger: ToolingLog; }): Promise> { const ruleResponse = await retry>({ - test: async () => { + testFn: async () => { const response = await supertest.get(`/api/alerting/rule/${id}`); const { execution_status: executionStatus } = response.body || {}; const { status } = executionStatus || {}; @@ -74,7 +74,7 @@ export async function waitForDocumentInIndex({ retryDelay?: number; }): Promise>> { return await retry>>({ - test: async () => { + testFn: async () => { const response = await esClient.search({ index: indexName, rest_total_hits_as_int: true, @@ -112,7 +112,7 @@ export async function waitForAlertInIndex({ logger: ToolingLog; }): Promise>> { return await retry>>({ - test: async () => { + testFn: async () => { const response = await esClient.search({ index: indexName, body: {