Skip to content

[8.x] [Response Ops][Task Manager] Adding integration test to ensure no `WorkloadAggregator` errors when there are unrecognized task types. (#193479)#194016

Merged
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-193479
Sep 25, 2024

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

…rkloadAggregator` errors when there are unrecognized task types. (elastic#193479)

Fixes elastic/kibana-team#1036

## Summary

Adding integration test as RCA action for incident where unrecognized
task types was causing issues generating the workload portion of the
task manager health report.

## To verify

Add this line to your code to that will throw an error when there are
unrecognized task types when generating the health report

```
--- a/x-pack/plugins/task_manager/server/task_type_dictionary.ts
+++ b/x-pack/plugins/task_manager/server/task_type_dictionary.ts
@@ -128,6 +128,7 @@ export class TaskTypeDictionary {
   }

   public get(type: string): TaskDefinition | undefined {
+    this.ensureHas(type);
     return this.definitions.get(type);
   }
```

Run the integration test `node scripts/jest_integration.js
x-pack/plugins/task_manager/server/integration_tests/removed_types.test.ts`
and see that it fails because a `WorkloadAggregator` error is logged.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 01eae15)
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ymao1

@kibanamachine kibanamachine merged commit 1108910 into elastic:8.x Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants