Skip to content

[tests] prevent unhandled rejection#109560

Merged
spalger merged 2 commits intoelastic:masterfrom
spalger:fix/promise-hygiene
Aug 23, 2021
Merged

[tests] prevent unhandled rejection#109560
spalger merged 2 commits intoelastic:masterfrom
spalger:fix/promise-hygiene

Conversation

@spalger
Copy link
Contributor

@spalger spalger commented Aug 20, 2021

@liza-mae has a scenario where an unhandled rejection is occurring because in the detection_enging_api_integration utils there is a helper which passes an async function to the Promise constructor, which leads to issues like this because rejections in the async function are not handled by the Promise constructor.

In this case the Promise constructor is not necessary so I just removed it so that failures will propagate properly.

@spalger spalger added Team:Operations Kibana-Operations Team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.14.0 v7.15.0 v7.16.0 labels Aug 20, 2021
@spalger spalger requested a review from a team as a code owner August 20, 2021 22:29
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@spalger
Copy link
Contributor Author

spalger commented Aug 23, 2021

@elasticmachine merge upstream

Copy link
Contributor

@FrankHassanabad FrankHassanabad left a comment

Choose a reason for hiding this comment

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

LGTM,

  • I looked through it and yeah, this fixes the promise being returned on the async function 👍

@spalger spalger enabled auto-merge (squash) August 23, 2021 16:41
@spalger spalger added the auto-backport Deprecated - use backport:version if exact versions are needed label Aug 23, 2021
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@spalger spalger merged commit 2381522 into elastic:master Aug 23, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 23, 2021
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 23, 2021
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 23, 2021
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.14
7.15
7.x

The backport PRs will be merged automatically after passing CI.

@spalger spalger deleted the fix/promise-hygiene branch August 23, 2021 18:51
kibanamachine added a commit that referenced this pull request Aug 23, 2021
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Aug 23, 2021
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Aug 23, 2021
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Operations Kibana-Operations Team v7.14.0 v7.15.0 v7.16.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants