Skip to content

Commit

Permalink
Add debug logging to session cleanup api integration test (elastic#19…
Browse files Browse the repository at this point in the history
…3259)

## 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:__ elastic#152260

(cherry picked from commit aaa53f5)
  • Loading branch information
SiddharthMantri committed Sep 19, 2024
1 parent 5a522bf commit 6fc89ed
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 6fc89ed

Please sign in to comment.