Skip to content

Commit

Permalink
[8.x] Add debug logging to session cleanup api integration test (#193259
Browse files Browse the repository at this point in the history
) (#193436)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Add debug logging to session cleanup api integration test
(#193259)](#193259)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Sid","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-18T11:57:03Z","message":"Add
debug logging to session cleanup api integration test (#193259)\n\n##
Summary\r\n\r\nAdd settings to the ES Test cluster to enable debug logs
so that if this\r\ntest fails in the future, we will have more logs to
investigate the\r\nissue.\r\n\r\n\r\n__Related:__
https://github.com/elastic/kibana/issues/152260","sha":"aaa53f5a31ffe094d2a71f614ce546983a821d57","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","release_note:skip","v9.0.0","backport:all-open"],"title":"Add
debug logging to session cleanup api integration
test","number":193259,"url":"https://github.com/elastic/kibana/pull/193259","mergeCommit":{"message":"Add
debug logging to session cleanup api integration test (#193259)\n\n##
Summary\r\n\r\nAdd settings to the ES Test cluster to enable debug logs
so that if this\r\ntest fails in the future, we will have more logs to
investigate the\r\nissue.\r\n\r\n\r\n__Related:__
https://github.com/elastic/kibana/issues/152260","sha":"aaa53f5a31ffe094d2a71f614ce546983a821d57"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193259","number":193259,"mergeCommit":{"message":"Add
debug logging to session cleanup api integration test (#193259)\n\n##
Summary\r\n\r\nAdd settings to the ES Test cluster to enable debug logs
so that if this\r\ntest fails in the future, we will have more logs to
investigate the\r\nissue.\r\n\r\n\r\n__Related:__
https://github.com/elastic/kibana/issues/152260","sha":"aaa53f5a31ffe094d2a71f614ce546983a821d57"}}]}]
BACKPORT-->

Co-authored-by: Sid <[email protected]>
  • Loading branch information
kibanamachine and SiddharthMantri authored Sep 19, 2024
1 parent b03acf3 commit 6ce928a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions x-pack/test/security_api_integration/tests/session_idle/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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*');
});

Expand Down

0 comments on commit 6ce928a

Please sign in to comment.