mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Dashboard] Fix flaky sync_colors.tsx
test (#172633)
## Summary It is possible for the `noDataPopover` to take more than the `100ms` timeout from `ensureHiddenNoDataPopover` (pictured below) to appear - in these cases, any tests that make use of the Lens page object's `goToTimeRange` method will fail due to clicking the wrong element (the tour step rather than the time picker).  While my initial thought was to simply increase the timeout for the `noDataPopover` check, this isn't ideal - **a lot** of tests use the `goToTimeRange` method and, by doing this, we would be slowing down **every single one of them** even when the test wouldn't have failed to begin with! Instead, I've chosen to surround the important parts of the code in `goToTimeRange` with a `retry` - that way, if the `noDataPopover` never shows up or it shows up comfortably within the `100ms` timeout, the impact to the speed of a given test will be **minimal**; however, if the no data popover shows up **outside** of this timeout, the retry will save the test from outright failure. ### [Flaky Test Runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4192)  ### 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
e1502e8b46
commit
d9e2d06512
2 changed files with 9 additions and 6 deletions
|
@ -57,6 +57,7 @@ export class TimePickerPageObject extends FtrService {
|
|||
});
|
||||
if (isVisible) {
|
||||
await this.testSubjects.click('noDataPopoverDismissButton');
|
||||
await this.testSubjects.waitForDeleted('noDataPopoverDismissButton');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -67,12 +67,14 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
|
|||
* a range that has data in our dataset.
|
||||
*/
|
||||
async goToTimeRange(fromTime?: string, toTime?: string) {
|
||||
await PageObjects.timePicker.ensureHiddenNoDataPopover();
|
||||
fromTime = fromTime || PageObjects.timePicker.defaultStartTime;
|
||||
toTime = toTime || PageObjects.timePicker.defaultEndTime;
|
||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
||||
// give some time for the update button tooltip to close
|
||||
await PageObjects.common.sleep(500);
|
||||
const from = fromTime || PageObjects.timePicker.defaultStartTime;
|
||||
const to = toTime || PageObjects.timePicker.defaultEndTime;
|
||||
await retry.try(async () => {
|
||||
await PageObjects.timePicker.ensureHiddenNoDataPopover();
|
||||
await PageObjects.timePicker.setAbsoluteRange(from, to);
|
||||
// give some time for the update button tooltip to close
|
||||
await PageObjects.common.sleep(500);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue