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

Failing test: Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/dashboard/group3/drilldowns/dashboard_to_dashboard_drilldown·ts - dashboard drilldowns Dashboard to dashboard drilldown Create & use drilldowns test dashboard to dashboard drilldown with controls creates filter pills representing controls selections #154071

Closed
kibanamachine opened this issue Mar 30, 2023 · 7 comments · Fixed by #154293
Assignees
Labels
failed-test A test failure on a tracked branch, potentially flaky-test impact:critical This issue should be addressed immediately due to a critical level of impact on the product. loe:medium Medium Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented Mar 30, 2023

A test failed on a tracked branch

Error: expected false to equal true
    at Assertion.assert (expect.js:100:11)
    at Assertion.apply (expect.js:227:8)
    at Assertion.be (expect.js:69:22)
    at Context.<anonymous> (dashboard_to_dashboard_drilldown.ts:344:69)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.apply (wrap_function.js:73:16)

First failure: CI Build - main

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label Mar 30, 2023
@botelastic botelastic bot added the needs-team Issues missing a team label label Mar 30, 2023
@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@jbudz
Copy link
Member

jbudz commented Mar 30, 2023

/skip

@jbudz jbudz added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas label Mar 30, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Mar 30, 2023
@kibanamachine
Copy link
Contributor Author

Skipped

main: a9af9e7

@Heenawter Heenawter added the impact:critical This issue should be addressed immediately due to a critical level of impact on the product. label Mar 30, 2023
@ThomThomson
Copy link
Contributor

This is really strange - it's looking for the filter pills from the control selections, but they aren't there at all. I wonder if this is some sort of rare race condition. The lines it fails on are:

expect(await filterBar.hasFilter('geo.src', 'CN, US')).to.be(true);
expect(await filterBar.hasFilter('bytes', '1,000 to 15,000')).to.be(true);

It's only got the filter taken from the drilldown itself:
dashboard drilldowns Dashboard to dashboard drilldown Create  use drilldowns tes-007c1692e627df5362b78a2b2ee754e04e613f5a7d11eced576730461e76c562

@ThomThomson ThomThomson self-assigned this Mar 30, 2023
@Heenawter
Copy link
Contributor

@ThomThomson The problem with these tests is the failure could come from two places: (1) the selections made in the controls from the source dashboard could have failed somehow or (2) the destination dashboard just didn't receive the selections (due to possibly a race condition, as you mentioned).

I wonder if it would be worth adding extra checks to optionsListPopoverSelectOption and rangeSliderSet<Upper/Lower>Bound to ensure the selections are actually made? Or we could just add some extra checks to the before ('add controls and make selections') to ensure the selections are made before navigating to the destination dashboard.

@ThomThomson
Copy link
Contributor

Very good point / idea! Why don't we modify the selection methods to ensure that the selections actually apply - that way we can at least narrow down which of the two problems we're facing here.

@Heenawter Heenawter assigned Heenawter and unassigned ThomThomson Mar 30, 2023
@Heenawter Heenawter added the loe:medium Medium Level of Effort label Apr 6, 2023
Heenawter added a commit that referenced this issue Apr 6, 2023
Closes #154071

## Summary

**Before:**

Before this PR, the dashboard's children would start being
loaded/initialized **before** the control group was necessarily ready -
this caused a race condition where, when the children tried to get their
inherited input, if the control group wasn't quite ready yet, then they
would not receive the control group's filters for their initialization.

So, on first load of a dashboard with one or more controls with
selections, it was possible for the contents of a dashboard to **not
reflect** the control selections, like so:

![Screenshot 2023-04-06 at 1 54 16
PM](https://user-images.githubusercontent.com/8698078/230481821-624221ff-cbee-4288-af24-c7cede312f14.png)

This obviously caused flakiness for the drilldown test, because if the
children in the source dashboard did not receive the inherited input
from the control group, then the drilldown **also** wouldn't pass down
the control group filters.

**After:**

To avoid this race condition, the dashboard now waits until the control
group is ready **before** the children can be loaded - so, when the
children try to get their inherited input, it should **always** contain
the control group's output filters:

![Screenshot 2023-04-06 at 1 59 15
PM](https://user-images.githubusercontent.com/8698078/230484589-a43c3292-3a6b-4f07-8a89-8ec181141024.png)




### Flaky Test Runner

<a
href="https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2099"><img
src="https://user-images.githubusercontent.com/8698078/230492496-d9f6e3c0-5a20-4c1e-bbab-fe90a275229e.png"/></a>

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test impact:critical This issue should be addressed immediately due to a critical level of impact on the product. loe:medium Medium Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants