Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Failing test: Jest Integration Tests.x-pack/platform/plugins/shared/task_manager/server/integration_tests - unrecognized task types should be no workload aggregator errors when there are removed task types #210399

Merged
merged 7 commits into from
Feb 12, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jest.mock('../monitoring/workload_statistics', () => {
};
});

// FLAKY: https://github.com/elastic/kibana/issues/208459
describe.skip('unrecognized task types', () => {
describe('unrecognized task types', () => {
let esServer: TestElasticsearchUtils;
let kibanaServer: TestKibanaUtils;
let taskManagerPlugin: TaskManagerStartContract;
Expand Down Expand Up @@ -114,8 +113,16 @@ describe.skip('unrecognized task types', () => {
taskIdsToRemove.push(notRegisteredTypeId);

// To be sure that the background task that marks removed tasks as unrecognized has run after the tasks were created
const runSoonResponse = await taskManagerPlugin.runSoon('mark_removed_tasks_as_unrecognized');
expect(runSoonResponse).toEqual({ id: 'mark_removed_tasks_as_unrecognized' });
await retry(async () => {
try {
const runSoonResponse = await taskManagerPlugin.runSoon(
'mark_removed_tasks_as_unrecognized'
);
expect(runSoonResponse).toEqual({ id: 'mark_removed_tasks_as_unrecognized' });
} catch (err) {
// ignore errors and retry
}
});

await retry(async () => {
const task = await getTask(kibanaServer.coreStart.elasticsearch.client.asInternalUser);
Expand Down