mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
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)
Resolves https://github.com/elastic/kibana/issues/208459 ## Summary The fix added in this [PR](https://github.com/elastic/kibana/pull/206598) to call the `mark_removed_tasks_as_unrecognized` tasks sometimes throws an error if the task is in the middle of running. This PR adds a try/catch and a retry to the `runSoon` call. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
6c257ab50c
commit
5500eab90c
1 changed files with 11 additions and 4 deletions
|
@ -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;
|
||||
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue