[8.x] Fixes Failing test: Jest Integration Tests.x-pack/plugins/task_manager/server/integration_tests - unrecognized task types should be no workload aggregator errors when there are removed task types (#195496) (#195677)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Fixes Failing test: Jest Integration
Tests.x-pack/plugins/task_manager/server/integration_tests -
unrecognized task types should be no workload aggregator errors when
there are removed task types
(#195496)](https://github.com/elastic/kibana/pull/195496)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ying
Mao","email":"ying.mao@elastic.co"},"sourceCommit":{"committedDate":"2024-10-09T21:01:49Z","message":"Fixes
Failing test: Jest Integration
Tests.x-pack/plugins/task_manager/server/integration_tests -
unrecognized task types should be no workload aggregator errors when
there are removed task types (#195496)\n\nResolves
https://github.com/elastic/kibana/issues/194208\r\n\r\n##
Summary\r\n\r\nThe original integration test was checking for the (non)
existence of\r\nany error logs on startup when there are removed task
types, which was\r\nnot specific enough because there were occasionally
error logs like\r\n\r\n```\r\n\"Task SLO:ORPHAN_SUMMARIES-CLEANUP-TASK
\\\"SLO:ORPHAN_SUMMARIES-CLEANUP-TASK:1.0.0\\\" failed: ResponseError:
search_phase_execution_exception\r\n```\r\n\r\nso this PR updates the
integration test to check specifically for\r\nworkload aggregator error
logs\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"742cd1336e71d2236608450e2a6a77b3ce9b3c4c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Task
Manager","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.16.0"],"title":"Fixes
Failing test: Jest Integration
Tests.x-pack/plugins/task_manager/server/integration_tests -
unrecognized task types should be no workload aggregator errors when
there are removed task
types","number":195496,"url":"https://github.com/elastic/kibana/pull/195496","mergeCommit":{"message":"Fixes
Failing test: Jest Integration
Tests.x-pack/plugins/task_manager/server/integration_tests -
unrecognized task types should be no workload aggregator errors when
there are removed task types (#195496)\n\nResolves
https://github.com/elastic/kibana/issues/194208\r\n\r\n##
Summary\r\n\r\nThe original integration test was checking for the (non)
existence of\r\nany error logs on startup when there are removed task
types, which was\r\nnot specific enough because there were occasionally
error logs like\r\n\r\n```\r\n\"Task SLO:ORPHAN_SUMMARIES-CLEANUP-TASK
\\\"SLO:ORPHAN_SUMMARIES-CLEANUP-TASK:1.0.0\\\" failed: ResponseError:
search_phase_execution_exception\r\n```\r\n\r\nso this PR updates the
integration test to check specifically for\r\nworkload aggregator error
logs\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"742cd1336e71d2236608450e2a6a77b3ce9b3c4c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195496","number":195496,"mergeCommit":{"message":"Fixes
Failing test: Jest Integration
Tests.x-pack/plugins/task_manager/server/integration_tests -
unrecognized task types should be no workload aggregator errors when
there are removed task types (#195496)\n\nResolves
https://github.com/elastic/kibana/issues/194208\r\n\r\n##
Summary\r\n\r\nThe original integration test was checking for the (non)
existence of\r\nany error logs on startup when there are removed task
types, which was\r\nnot specific enough because there were occasionally
error logs like\r\n\r\n```\r\n\"Task SLO:ORPHAN_SUMMARIES-CLEANUP-TASK
\\\"SLO:ORPHAN_SUMMARIES-CLEANUP-TASK:1.0.0\\\" failed: ResponseError:
search_phase_execution_exception\r\n```\r\n\r\nso this PR updates the
integration test to check specifically for\r\nworkload aggregator error
logs\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"742cd1336e71d2236608450e2a6a77b3ce9b3c4c"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ying Mao <ying.mao@elastic.co>
This commit is contained in:
Kibana Machine 2024-10-10 09:39:13 +11:00 committed by GitHub
parent a3da12562d
commit 1d96fac969
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,7 +121,15 @@ describe('unrecognized task types', () => {
// so we want to wait that long to let it refresh
await new Promise((r) => setTimeout(r, 5100));
expect(errorLogSpy).not.toHaveBeenCalled();
const errorLogCalls = errorLogSpy.mock.calls[0];
// if there are any error logs, none of them should be workload aggregator errors
if (errorLogCalls) {
// should be no workload aggregator errors
for (const elog of errorLogCalls) {
expect(elog).not.toMatch(/^\[WorkloadAggregator\]: Error: Unsupported task type/i);
}
}
});
});