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

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Feb 10, 2025

Resolves #208459

Summary

The fix added in this PR 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.

@ymao1 ymao1 changed the title Retrying runSoon 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 Feb 10, 2025
@ymao1 ymao1 self-assigned this Feb 10, 2025
@ymao1 ymao1 added v9.0.0 v8.18.0 v9.1.0 v8.19.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) backport:version Backport to applied version labels labels Feb 10, 2025
@elasticmachine
Copy link
Contributor

elasticmachine commented Feb 10, 2025

💔 Build Failed

Failed CI Steps

Metrics [docs]

✅ unchanged

History

cc @ymao1

@ymao1
Copy link
Contributor Author

ymao1 commented Feb 11, 2025

@elasticmachine merge upstream

@ymao1 ymao1 marked this pull request as ready for review February 11, 2025 15:00
@ymao1 ymao1 requested a review from a team as a code owner February 11, 2025 15:00
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@ymao1 ymao1 requested review from pmuellr and ersin-erdal February 11, 2025 15:00
Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, wondering whether we should leave the message check in the catch there, for "future-proofing"

} catch (err) {
// it's possible the task is already running, so catch those errors and retry
// otherwise throw
if (!err.message.includes('as it is currently running')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we bother checking this? Wondering if this will get flaky if an error message changes in the future ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can remove and we can retry in the case of any error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 8c6887f

@ymao1 ymao1 merged commit 5500eab into elastic:main Feb 12, 2025
9 checks passed
@ymao1 ymao1 deleted the flaky-test-208459 branch February 12, 2025 14:30
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13287701882

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 12, 2025
…ared/task_manager/server/integration_tests - unrecognized task types should be no workload aggregator errors when there are removed task types (elastic#210399)

Resolves elastic#208459

## Summary

The fix added in this
[PR](elastic#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>
(cherry picked from commit 5500eab)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 12, 2025
…ared/task_manager/server/integration_tests - unrecognized task types should be no workload aggregator errors when there are removed task types (elastic#210399)

Resolves elastic#208459

## Summary

The fix added in this
[PR](elastic#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>
(cherry picked from commit 5500eab)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 12, 2025
…ared/task_manager/server/integration_tests - unrecognized task types should be no workload aggregator errors when there are removed task types (elastic#210399)

Resolves elastic#208459

## Summary

The fix added in this
[PR](elastic#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>
(cherry picked from commit 5500eab)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.x
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Feb 12, 2025
…gins/shared/task_manager/server/integration_tests - unrecognized task types should be no workload aggregator errors when there are removed task types (#210399) (#210842)

# Backport

This will backport the following commits from `main` to `8.18`:
- [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)](#210399)

<!--- 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":"2025-02-12T14:30:38Z","message":"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)\n\nResolves
https://github.com/elastic/kibana/issues/208459\r\n\r\n##
Summary\r\n\r\nThe fix added in
this\r\n[PR](#206598) to call
the\r\n`mark_removed_tasks_as_unrecognized` tasks sometimes throws an
error if\r\nthe task is in the middle of running. This PR adds a
try/catch and a\r\nretry to the `runSoon`
call.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"5500eab90ca7053a7741f9274e3886f4a7460228","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Task
Manager","Team:ResponseOps","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"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","number":210399,"url":"https://github.com/elastic/kibana/pull/210399","mergeCommit":{"message":"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)\n\nResolves
https://github.com/elastic/kibana/issues/208459\r\n\r\n##
Summary\r\n\r\nThe fix added in
this\r\n[PR](#206598) to call
the\r\n`mark_removed_tasks_as_unrecognized` tasks sometimes throws an
error if\r\nthe task is in the middle of running. This PR adds a
try/catch and a\r\nretry to the `runSoon`
call.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"5500eab90ca7053a7741f9274e3886f4a7460228"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210399","number":210399,"mergeCommit":{"message":"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)\n\nResolves
https://github.com/elastic/kibana/issues/208459\r\n\r\n##
Summary\r\n\r\nThe fix added in
this\r\n[PR](#206598) to call
the\r\n`mark_removed_tasks_as_unrecognized` tasks sometimes throws an
error if\r\nthe task is in the middle of running. This PR adds a
try/catch and a\r\nretry to the `runSoon`
call.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"5500eab90ca7053a7741f9274e3886f4a7460228"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ying Mao <ying.mao@elastic.co>
kibanamachine added a commit that referenced this pull request Feb 12, 2025
…ins/shared/task_manager/server/integration_tests - unrecognized task types should be no workload aggregator errors when there are removed task types (#210399) (#210843)

# Backport

This will backport the following commits from `main` to `8.x`:
- [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)](#210399)

<!--- 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":"2025-02-12T14:30:38Z","message":"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)\n\nResolves
https://github.com/elastic/kibana/issues/208459\r\n\r\n##
Summary\r\n\r\nThe fix added in
this\r\n[PR](#206598) to call
the\r\n`mark_removed_tasks_as_unrecognized` tasks sometimes throws an
error if\r\nthe task is in the middle of running. This PR adds a
try/catch and a\r\nretry to the `runSoon`
call.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"5500eab90ca7053a7741f9274e3886f4a7460228","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Task
Manager","Team:ResponseOps","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"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","number":210399,"url":"https://github.com/elastic/kibana/pull/210399","mergeCommit":{"message":"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)\n\nResolves
https://github.com/elastic/kibana/issues/208459\r\n\r\n##
Summary\r\n\r\nThe fix added in
this\r\n[PR](#206598) to call
the\r\n`mark_removed_tasks_as_unrecognized` tasks sometimes throws an
error if\r\nthe task is in the middle of running. This PR adds a
try/catch and a\r\nretry to the `runSoon`
call.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"5500eab90ca7053a7741f9274e3886f4a7460228"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210399","number":210399,"mergeCommit":{"message":"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)\n\nResolves
https://github.com/elastic/kibana/issues/208459\r\n\r\n##
Summary\r\n\r\nThe fix added in
this\r\n[PR](#206598) to call
the\r\n`mark_removed_tasks_as_unrecognized` tasks sometimes throws an
error if\r\nthe task is in the middle of running. This PR adds a
try/catch and a\r\nretry to the `runSoon`
call.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"5500eab90ca7053a7741f9274e3886f4a7460228"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ying Mao <ying.mao@elastic.co>
kibanamachine added a commit that referenced this pull request Feb 12, 2025
…ins/shared/task_manager/server/integration_tests - unrecognized task types should be no workload aggregator errors when there are removed task types (#210399) (#210844)

# Backport

This will backport the following commits from `main` to `9.0`:
- [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)](#210399)

<!--- 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":"2025-02-12T14:30:38Z","message":"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)\n\nResolves
https://github.com/elastic/kibana/issues/208459\r\n\r\n##
Summary\r\n\r\nThe fix added in
this\r\n[PR](#206598) to call
the\r\n`mark_removed_tasks_as_unrecognized` tasks sometimes throws an
error if\r\nthe task is in the middle of running. This PR adds a
try/catch and a\r\nretry to the `runSoon`
call.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"5500eab90ca7053a7741f9274e3886f4a7460228","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Task
Manager","Team:ResponseOps","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"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","number":210399,"url":"https://github.com/elastic/kibana/pull/210399","mergeCommit":{"message":"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)\n\nResolves
https://github.com/elastic/kibana/issues/208459\r\n\r\n##
Summary\r\n\r\nThe fix added in
this\r\n[PR](#206598) to call
the\r\n`mark_removed_tasks_as_unrecognized` tasks sometimes throws an
error if\r\nthe task is in the middle of running. This PR adds a
try/catch and a\r\nretry to the `runSoon`
call.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"5500eab90ca7053a7741f9274e3886f4a7460228"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210399","number":210399,"mergeCommit":{"message":"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)\n\nResolves
https://github.com/elastic/kibana/issues/208459\r\n\r\n##
Summary\r\n\r\nThe fix added in
this\r\n[PR](#206598) to call
the\r\n`mark_removed_tasks_as_unrecognized` tasks sometimes throws an
error if\r\nthe task is in the middle of running. This PR adds a
try/catch and a\r\nretry to the `runSoon`
call.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"5500eab90ca7053a7741f9274e3886f4a7460228"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ying Mao <ying.mao@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Task Manager release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.18.0 v8.19.0 v9.0.0 v9.1.0
Projects
None yet
4 participants