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

[Uptime] Add delay in telemetry test #75162

Merged
merged 10 commits into from
Aug 21, 2020

Conversation

shahzad31
Copy link
Contributor

Summary

Fixes: #72852

This test has been rarely flaky, this change should ensure that we will not see that flakiness anymore, it just add a delay before request is issued.

@shahzad31 shahzad31 self-assigned this Aug 17, 2020
@shahzad31 shahzad31 added release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.10.0 v8.0.0 labels Aug 17, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@shahzad31 shahzad31 requested a review from justinkambic August 17, 2020 14:07
@@ -119,6 +122,8 @@ export default function ({ getService }: FtrProviderContext) {
});

it('should receive expected results after calling overview logging', async () => {
// wait few seconds to make sure data is refreshed, just to avoid flakiness
await delay(2000);
// call overview page
const { body: result } = await supertest
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might make sense to try wrapping this supertest call in a retry block instead of hardcoding delay values. In the past when I have attempted to implement similar solutions I have usually gotten pushback because it goes against the typical pattern used when trying to keep these tests maintainable. cc @spalger

Copy link
Contributor

Choose a reason for hiding this comment

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

My concern isn't about consistency, it's about the fact that the delay is only necessary if there's something we should be waiting for but we're not waiting for it.

What should these tests be waiting for? Can we add a wait for that thing? If we can't, then we can try retrying.

Delay's seem to work today, but they age out as performance characteristics change and become very difficult to maintain over time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i agree, will do that

@justinkambic justinkambic requested a review from spalger August 17, 2020 14:34
@shahzad31 shahzad31 requested a review from justinkambic August 18, 2020 14:36
@@ -84,6 +86,7 @@ export default function ({ getService }: FtrProviderContext) {
after('unload heartbeat index', () => getService('esArchiver').unload('uptime/blank'));

beforeEach(async () => {
await delay(1000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the delay still needed since we've removed the check for the API response and are now just checking the response code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed.

@shahzad31 shahzad31 requested a review from justinkambic August 19, 2020 12:53
Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

I don't see anything wrong technically with this test, but I'll defer to @justinkambic to review the meaning of the change here. I worry that we're no longer testing that we "receive expected results"

@shahzad31
Copy link
Contributor Author

I don't see anything wrong technically with this test, but I'll defer to @justinkambic to review the meaning of the change here. I worry that we're no longer testing that we "receive expected results"

@spalger yeah we are actually already unit testing that part, it was really hard to reliably test this query.

@justinkambic
Copy link
Contributor

@spalger we investigated and determined that we have unit tests covering how the server processes this input.

@spalger
Copy link
Contributor

spalger commented Aug 20, 2020

Cool, then maybe we should rename the test

@shahzad31
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

@shahzad31 shahzad31 merged commit 506bf6c into elastic:master Aug 21, 2020
@shahzad31 shahzad31 deleted the improve-telemetry-test branch August 21, 2020 10:10
shahzad31 added a commit to shahzad31/kibana that referenced this pull request Aug 21, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
shahzad31 added a commit that referenced this pull request Aug 21, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Aug 21, 2020
* master: (71 commits)
  [Lens] Show 'No data for this field' for empty field in accordion (elastic#73772)
  Skip failing lens test
  Configure ScopedHistory consistenty regardless of URL used to mount app (elastic#75074)
  Fix returned payload by "search" usage collector (elastic#75340)
  [Security Solution] Fix missing key error (elastic#75576)
  Upgrade EUI to v27.4.1 (elastic#75240)
  Update datasets UI copy to data streams (elastic#75618)
  [Lens] Register saved object references (elastic#74523)
  [DOCS] Update links to Beats documentation (elastic#70380)
  [Enterprise Search] Convert our `public_url` route to `config_data` and collect initialAppData (elastic#75616)
  [Usage Collection Schemas] Remove Legacy entries (elastic#75652)
  [Dashboard First] Lens Originating App Breadcrumb (elastic#75470)
  Improve login UI error message. (elastic#75642)
  [Security Solution] modify circular deps checker to output images of circular deps graphs (elastic#75579)
  [Data Telemetry] Add index pattern to identify "meow" attacks (elastic#75163)
  Migrate CSP usage collector to `kibana_usage_collection` plugin (elastic#75536)
  [Console] Get ES Config from core (elastic#75406)
  [Uptime] Add delay in telemetry test (elastic#75162)
  [Lens] Use index pattern service instead saved object client (elastic#74654)
  Embeddable input (elastic#73033)
  ...
thomasneirynck pushed a commit to thomasneirynck/kibana that referenced this pull request Aug 21, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.10.0 v8.0.0
Projects
None yet
5 participants