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

Can't set timerange correctly during functional tests #113520

Open
timroes opened this issue Sep 30, 2021 · 9 comments
Open

Can't set timerange correctly during functional tests #113520

timroes opened this issue Sep 30, 2021 · 9 comments
Labels
bug Fixes for quality problems that affect the customer experience failed-test A test failure on a tracked branch, potentially flaky-test Team:QA Team label for QA Team

Comments

@timroes
Copy link
Contributor

timroes commented Sep 30, 2021

It seems recently we're seeing a lot of test failures caused by the time range not being set correctly. I've seen a couple of test failures where the "to" date is correctly set, but the "from" date is not set correctly. Failure screenshots might then look like the following (pay attention to the dates in the timepicker):

discover feature controls spaces space with no features disabled shows visualize field button

This seems to happen across the board in different apps and different tests. I suspect the PageObjects.timePicker.setAbsoluteRange might have some problems with potentially some changes we did in EUI?
I think this needs some investigation. I mostly linked Discover failures below, but I've seen this failing across other apps (e.g. Dashboard) too.

List of affected test failures:

@timroes timroes added bug Fixes for quality problems that affect the customer experience Team:QA Team label for QA Team failed-test A test failure on a tracked branch, potentially flaky-test labels Sep 30, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-qa (Team:QA)

@LeeDr
Copy link

LeeDr commented Sep 30, 2021

Test automation on the timepicker has been a pain for quite some time. Many people including me have spent hours and hours trying to get automation on it to work reliably.

  1. @dmlemeshko is looking at wrapping the setAbsoluteTime method in a retry with verification
  2. @wayneseymour has it on his TODO list to start replacing many instances of setting the timepicker by setting the timepicker:defaultTimes before navigating to the page as in this example
    https://github.com/elastic/kibana/blob/master/test/functional/apps/discover/_indexpattern_without_timefield.ts#L28
before
      await kibanaServer.uiSettings.replace({
        'timepicker:timeDefaults': '{  "from": "2019-01-18T19:37:13.000Z",  "to": "now"}',
      });
after
      await kibanaServer.uiSettings.unset('timepicker:timeDefaults');
  1. We should leave at least 1 instance of using the timepicker in each page (and/or make sure there are good component level tests)

@flash1293
Copy link
Contributor

cc @stratoula I think we had a case of this as well, right?

@stratoula
Copy link
Contributor

Yes we had this one #113496
I am not sure about the solution I provided #113535 but it seems that it stabilizes it. Of course I have ran it only 100 times.

@flash1293
Copy link
Contributor

@stratoula Seems like it didn't hold: #113496

@stratoula
Copy link
Contributor

:( Ok I will try to use the solution provided by Lee

@timroes
Copy link
Contributor Author

timroes commented Oct 4, 2021

I am not sure if it makes sense trying to fix this now for each test individually. I think we need to come up with a central more safe solution for setting the timepicker, i.e. what Lee mentioned under point 1.

I'd for now just disable the test, and add it to the list above, so we can unskip all those tests once we have fixed that globally.

@timroes
Copy link
Contributor Author

timroes commented Oct 7, 2021

I believe this is not yet solved via #113597. A lot of the tests that were unskipped in this PR, started immediately again to behave flaky after that PR got merged. It just seems - assuming because we're now properly test for the date being set - that instead of seeing the date not being set, we run into timeouts in all those tests (e.g. see #60559).

I know that @pheyos (#113905) and @brianseeders (#104022, #112576) have been working on trying to address the timeout issues too. As far as I understand #113905 should at least enable us getting screenshots now from those timeout failures again? (which will help us seeing if this assumption here is actually true).

@pheyos
Copy link
Member

pheyos commented Oct 7, 2021

As far as I understand #113905 should at least enable us getting screenshots now from those timeout failures again?

@timroes yes, for the cases where retry.waitFor or retry.waitForWithTimeout are used, we should now get regular wait timeouts, which will create screenshots.
There might still be other cases that trigger the outer test runner timeout, leading to a killed test execution and no screenshot, but at this point I'm not aware of such a case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience failed-test A test failure on a tracked branch, potentially flaky-test Team:QA Team label for QA Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants