From aaa53f5a31ffe094d2a71f614ce546983a821d57 Mon Sep 17 00:00:00 2001 From: Sid Date: Wed, 18 Sep 2024 13:57:03 +0200 Subject: [PATCH] Add debug logging to session cleanup api integration test (#193259) ## Summary Add settings to the ES Test cluster to enable debug logs so that if this test fails in the future, we will have more logs to investigate the issue. __Related:__ https://github.com/elastic/kibana/issues/152260 --- .../tests/session_idle/cleanup.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts b/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts index 9af51a859befa..4a74e3938467e 100644 --- a/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts +++ b/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts @@ -18,6 +18,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertestWithoutAuth'); + const esSupertest = getService('esSupertest'); const es = getService('es'); const esDeleteAllIndices = getService('esDeleteAllIndices'); const config = getService('config'); @@ -93,9 +94,19 @@ export default function ({ getService }: FtrProviderContext) { }); } + async function addESDebugLoggingSettings() { + const addLogging = { + persistent: { + 'logger.org.elasticsearch.xpack.security.authc': 'debug', + }, + }; + await esSupertest.put('/_cluster/settings').send(addLogging).expect(200); + } + describe('Session Idle cleanup', () => { beforeEach(async () => { await es.cluster.health({ index: '.kibana_security_session*', wait_for_status: 'green' }); + await addESDebugLoggingSettings(); await esDeleteAllIndices('.kibana_security_session*'); });