-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Monitoring] Await promise properly #29001
[Monitoring] Await promise properly #29001
Conversation
Pinging @elastic/stack-monitoring |
💔 Build Failed |
@@ -103,7 +103,7 @@ export class BulkUploader { | |||
if (payload) { | |||
try { | |||
this._log.debug(`Uploading bulk stats payload to the local cluster`); | |||
this._onPayload(payload); | |||
await this._onPayload(payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to await this on the tests that mock Elasticsearch, then assert that it sent the payload (or failed) with itself returning until it did that while also avoiding an exception being thrown from this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will work: be5c697
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinging my favorite Chris @pickypg!
💚 Build Succeeded |
cc @mattapperson @justinkambic Either of you able to look at this this week? |
* Await this promise * Add one additional log message and a test around that
Backport: 6.x: 67dc8c0 |
Fixes #28989
Properly awaits the promise.
Unfortunately, I couldn't figure a good way to add a test for this, or modify the existing tests. Any thoughts here would be appreciated
cc @pickypg