From be6a146070b57dee7b6ff9f53509c1b2c58ac092 Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Thu, 19 Sep 2024 14:21:44 +0300 Subject: [PATCH] [Security Solution] Make retry messages in `retryIfDeleteByQueryConflicts` loggable (#193117) ## Summary This makes retry messages in `retryIfDeleteByQueryConflicts()` helper function visible in CI logs. ## Details According to the [implementation](https://github.com/elastic/kibana/blob/main/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/reporter.js#L71-L74) only error messages logged via `ToolingLog` piped to the CI log. It happens only when `mochaReporter.captureLogOutput` flag is set to `true`. According to the [schema](https://github.com/elastic/kibana/blob/eabb1022815a7c661a0e642c62d0a77ce338f9c9/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts#L175) `captureLogOutput` has `true` value in CI and there is no `DISABLE_CI_LOG_OUTPUT_CAPTURE` env variable set. It was [tested](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6978#01920936-b484-4dfb-a87b-ae40858c9ff5) in flaky test runner. Error messages a logged as expected. (cherry picked from commit 067d949d2c914b87fbbe88f469e005dcf59a0310) --- .../utils/retry_delete_by_query_conflicts.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/retry_delete_by_query_conflicts.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/retry_delete_by_query_conflicts.ts index de7e1afd163c9..e7710e2c21ad9 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/retry_delete_by_query_conflicts.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/retry_delete_by_query_conflicts.ts @@ -29,13 +29,12 @@ export async function retryIfDeleteByQueryConflicts( const operationResult = await operation(); if (!operationResult.failures || operationResult.failures?.length === 0) { - logger.info(`${name} finished successfully`); return operationResult; } const failureCause = operationResult.failures.map((failure) => failure.cause).join(', '); - logger.warning(`Unable to delete by query ${name}. Caused by: "${failureCause}". Retrying ...`); + logger.error(`Unable to delete by query ${name}. Caused by: "${failureCause}". Retrying ...`); await waitBeforeNextRetry(retryDelay); }