Skip to content

Commit

Permalink
Unskip Session Concurrent Limit cleanup tests. (elastic#173828)
Browse files Browse the repository at this point in the history
## Summary

Unskip `Session Concurrent Limit cleanup` tests.

__Flaky Test Runner#1 (no changes, only unskipped tests):__
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4666
(x100 - 🔴 1 out of 100)
__Flaky Test Runner#2 (added additional `retry`):__
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4667
(x200 - all 🟢)

__Fixes: https://github.com/elastic/kibana/issues/149091__
  • Loading branch information
azasypkin authored Dec 21, 2023
1 parent 574ff80 commit f6b7df3
Showing 1 changed file with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ export default function ({ getService }: FtrProviderContext) {
});
}

// Failing: See https://github.com/elastic/kibana/issues/149091
describe.skip('Session Concurrent Limit cleanup', () => {
describe('Session Concurrent Limit cleanup', () => {
before(async () => {
await security.user.create('anonymous_user', {
password: 'changeme',
Expand Down Expand Up @@ -181,7 +180,10 @@ export default function ({ getService }: FtrProviderContext) {
await setTimeoutAsync(500);
const basicSessionCookieThree = await loginWithBasic(testUser);

expect(await getNumberOfSessionDocuments()).to.be(3);
log.debug('Waiting for all sessions to be persisted...');
await retry.tryForTime(20000, async () => {
expect(await getNumberOfSessionDocuments()).to.be(3);
});

// Poke the background task to run
await runCleanupTaskSoon();
Expand Down Expand Up @@ -210,7 +212,10 @@ export default function ({ getService }: FtrProviderContext) {
const basicSessionCookieThree = await loginWithBasic(testUser);
const samlSessionCookieThree = await loginWithSAML();

expect(await getNumberOfSessionDocuments()).to.be(6);
log.debug('Waiting for all sessions to be persisted...');
await retry.tryForTime(20000, async () => {
expect(await getNumberOfSessionDocuments()).to.be(6);
});

// Poke the background task to run
await runCleanupTaskSoon();
Expand Down Expand Up @@ -243,7 +248,10 @@ export default function ({ getService }: FtrProviderContext) {
const basicSessionCookieThree = await loginWithBasic(testUser);
const samlSessionCookieThree = await loginWithSAML();

expect(await getNumberOfSessionDocuments()).to.be(6);
log.debug('Waiting for all sessions to be persisted...');
await retry.tryForTime(20000, async () => {
expect(await getNumberOfSessionDocuments()).to.be(6);
});

// Remove `createdAt` field from the most recent sessions to emulate legacy sessions.
// 1. Get the latest session for every unique credentials.
Expand Down Expand Up @@ -305,7 +313,10 @@ export default function ({ getService }: FtrProviderContext) {
await setTimeoutAsync(500);
const basicSessionCookieTwo = await loginWithBasic(testUser);

expect(await getNumberOfSessionDocuments()).to.be(2);
log.debug('Waiting for all sessions to be persisted...');
await retry.tryForTime(20000, async () => {
expect(await getNumberOfSessionDocuments()).to.be(2);
});

// Poke the background task to run
await runCleanupTaskSoon();
Expand All @@ -328,7 +339,10 @@ export default function ({ getService }: FtrProviderContext) {
const anonymousSessionCookieTwo = await loginWithAnonymous();
const anonymousSessionCookieThree = await loginWithAnonymous();

expect(await getNumberOfSessionDocuments()).to.be(3);
log.debug('Waiting for all sessions to be persisted...');
await retry.tryForTime(20000, async () => {
expect(await getNumberOfSessionDocuments()).to.be(3);
});

// Poke the background task to run
await runCleanupTaskSoon();
Expand Down Expand Up @@ -357,7 +371,10 @@ export default function ({ getService }: FtrProviderContext) {
const unauthenticatedSessionTwo = await startSAMLHandshake();
const unauthenticatedSessionThree = await startSAMLHandshake();

expect(await getNumberOfSessionDocuments()).to.be(3);
log.debug('Waiting for all sessions to be persisted...');
await retry.tryForTime(20000, async () => {
expect(await getNumberOfSessionDocuments()).to.be(3);
});

// Poke the background task to run
await runCleanupTaskSoon();
Expand Down

0 comments on commit f6b7df3

Please sign in to comment.