Skip to content

Commit

Permalink
Add debug logging to session cleanup api integration test (#193259)
Browse files Browse the repository at this point in the history
## 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:__ #152260
  • Loading branch information
SiddharthMantri authored Sep 18, 2024
1 parent c56281c commit aaa53f5
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 aaa53f5

Please sign in to comment.