Skip to content

Commit

Permalink
[Response Ops][Task Manager] Integration test for switching between t…
Browse files Browse the repository at this point in the history
…ask claim strategies (elastic#186419)

Resolves elastic#184941

## Summary

Adds integration test to verify that restarting Kibana with a different
task claim strategy does not break anything and tasks are claimed as
expected.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
2 people authored and bhapas committed Jun 24, 2024
1 parent abbd938 commit 3b02197
Show file tree
Hide file tree
Showing 2 changed files with 410 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,8 @@
import deepmerge from 'deepmerge';
import { createTestServers, createRootWithCorePlugins } from '@kbn/core-test-helpers-kbn-server';

export async function setupTestServers(settings = {}) {
const { startES } = createTestServers({
adjustTimeout: (t) => jest.setTimeout(t),
settings: {
es: {
license: 'trial',
},
},
});

const esServer = await startES();

const root = createRootWithCorePlugins(
function createRoot(settings = {}) {
return createRootWithCorePlugins(
deepmerge(
{
logging: {
Expand All @@ -32,13 +21,35 @@ export async function setupTestServers(settings = {}) {
name: 'plugins.taskManager',
level: 'all',
},
{
name: 'plugins.taskManager.metrics-debugger',
level: 'warn',
},
{
name: 'plugins.taskManager.metrics-subscribe-debugger',
level: 'warn',
},
],
},
},
settings
),
{ oss: false }
);
}
export async function setupTestServers(settings = {}) {
const { startES } = createTestServers({
adjustTimeout: (t) => jest.setTimeout(t),
settings: {
es: {
license: 'trial',
},
},
});

const esServer = await startES();

const root = createRoot(settings);

await root.preboot();
const coreSetup = await root.setup();
Expand All @@ -54,3 +65,20 @@ export async function setupTestServers(settings = {}) {
},
};
}

export async function setupKibanaServer(settings = {}) {
const root = createRoot(settings);

await root.preboot();
const coreSetup = await root.setup();
const coreStart = await root.start();

return {
kibanaServer: {
root,
coreSetup,
coreStart,
stop: async () => await root.shutdown(),
},
};
}
Loading

0 comments on commit 3b02197

Please sign in to comment.