mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[Dashboard] [Controls] Fix inherited input race condition (#154293)
Closes https://github.com/elastic/kibana/issues/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:  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:  ### 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)
This commit is contained in:
parent
8e9a8ef019
commit
deeb783f8b
2 changed files with 4 additions and 5 deletions
|
@ -311,14 +311,14 @@ export class DashboardContainer extends Container<InheritedChildInput, Dashboard
|
|||
// update input so the redux embeddable tools get the unwrapped, initial input
|
||||
this.updateInput({ ...initialInput });
|
||||
|
||||
// now that the input with the initial panel state has been set, we can tell the container class it's time to start loading children.
|
||||
readyToInitializeChildren$.next(initialInput);
|
||||
|
||||
// build Control Group
|
||||
if (creationOptions?.useControlGroupIntegration) {
|
||||
this.controlGroup = await startControlGroupIntegration.bind(this)(initialInput);
|
||||
}
|
||||
|
||||
// now that the input with the initial panel state has been set and the control group is ready, we can tell the container class it's time to start loading children.
|
||||
readyToInitializeChildren$.next(initialInput);
|
||||
|
||||
// start diffing dashboard state
|
||||
const diffingMiddleware = startDiffingDashboardState.bind(this)({
|
||||
useSessionBackup: creationOptions?.useSessionStorageIntegration,
|
||||
|
|
|
@ -124,8 +124,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await PageObjects.dashboard.waitForRenderComplete();
|
||||
};
|
||||
|
||||
// Failing: See https://github.com/elastic/kibana/issues/154071
|
||||
describe.skip('Dashboard to dashboard drilldown', function () {
|
||||
describe('Dashboard to dashboard drilldown', function () {
|
||||
describe('Create & use drilldowns', () => {
|
||||
before(async () => {
|
||||
log.debug('Dashboard Drilldowns:initTests');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue