* [TSVB] Fix reappearing of hidden series on refresh and styles loading
* Add functional test
* Update condition and move loading component to another file
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Discover] Add a retry in a value suggestion non timebased test
* Dismiss popover before Discover even loads
* Set local storage value in navigateToApp
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [QA][refactor] discover test
Drop two saved objects: search and idx pattern,
in the after method.
Add the formatting fn to the common page,
such that every time setTime is invoked, the time is
formatted to address: https://momentjs.com/guides/#/warnings/js-date/
* Add docs, per CR.
* Add docs, per CR.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tre <wayne.seymour@elastic.co>
## Summary
Fixes flake tests of:
https://github.com/elastic/kibana/issues/115918https://github.com/elastic/kibana/issues/103273https://github.com/elastic/kibana/issues/108640https://github.com/elastic/kibana/issues/109447https://github.com/elastic/kibana/issues/100630https://github.com/elastic/kibana/issues/94535https://github.com/elastic/kibana/issues/104260
Security solution has been using `bsearch` and has encountered flake in various forms. Different developers have been fixing the flake in a few odd ways (myself included) which aren't 100%. This PR introduces a once-in-for-all REST API retry service called `bsearch` which will query `bsearch` and if `bsearch` is not completed because of async occurring due to slower CI runtimes it will continuously call into the `bsearch` with the correct API to ensure it gets a complete response before returning.
## Usage
Anyone can use this service like so:
```ts
const bsearch = getService('bsearch');
const response = await bsearch.send<MyType>({
supertest,
options: {
defaultIndex: ['large_volume_dns_data'],
}
strategy: 'securitySolutionSearchStrategy',
});
```
If you're using a custom auth then you can set that beforehand like so:
```ts
const bsearch = getService('bsearch');
const supertestWithoutAuth = getService('supertestWithoutAuth');
const supertest supertestWithoutAuth.auth(username, password);
const response = await bsearch.send<MyType>({
supertest,
options: {
defaultIndex: ['large_volume_dns_data'],
}
strategy: 'securitySolutionSearchStrategy',
});
```
## Misconceptions in the tests leading to flake
* Can you just call the bsearch REST API and it will always return data first time? Not always true, as when CI slows down or data increases `bsearch` will give you back an async reference and then your test will blow up.
* Can we wrap the REST API in `retry` to fix the flake? Not always but mostly true, as when CI slows down or data increases `bsearch` could return the async version continuously which could then fail your test. It's also tedious to tell everyone in code reviews to wrap everything in `retry` instead of just fixing it with a service as well as inform new people why we are constantly wrapping these tests in `retry`.
* Can we manually parse the `bsearch` if it has `async` for each test? This is true but is error prone and I did this for one test and it's ugly and I had issues as I have to wrap 2 things in `retry` and test several conditions. Also it's harder for people to read the tests rather than just reading there is a service call. Also people in code reviews missed where I had bugs with it. Also lots of boiler plate.
* Can we just increase the timeout with `wait_for_completion_timeout` and the tests will pass for sure then? Not true today but maybe true later, as this hasn't been added as plumbing yet. See this [open ticket](https://github.com/elastic/kibana/issues/107241). Even if it is and we increase the timeout to a very large number bsearch might return with an `async` or you might want to test the `async` path. Either way, if/when we add the ability we can increase it within 1 spot which is this service for everyone rather than going to each individual test to add it. If/when it's added if people don't use the bsearch service we can remove it later if we find this is deterministic enough and no one wants to test bsearch features with their strategies down the road.
## Manual test of bsearch service
If you want to manually watch the bsearch operate as if the CI system is running slow or to cause an `async` manually you manually modify this setting here:
https://github.com/elastic/kibana/blob/master/src/plugins/data/server/search/strategies/ese_search/request_utils.ts#L61
To be of a lower number such as `1ms` and then you will see it enter the `async` code within `bsearch` consistently
## Reference PRs
We cannot set the wait_for_complete just yet
https://github.com/elastic/kibana/issues/107241 so we decided this was the best way to reduce flake for testing for now.
### 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
# Conflicts:
# x-pack/test/api_integration/apis/security_solution/hosts.ts
* added page to reporting example app that contains the capture tests
* first version of PNG capture for test A
* added types file to common
* added data-shared-item attr to image, also added capture menu items
* fix image CSS by providing a fixed width and height
* explicitly add layout for print, does not seem to do anything though?
* added magic numbers of image sizes
* added reporting examples test folder
* first version of capture test for generating and comparing PNGs
* added PNG service and PNG baseline fixture
* added pdf-to-img dev dependency
* refactor compare_pngs to accept a buffer
* added comment to interface
* png service -> compare images service
* export image compare service
* added test for pdf export
* clean up log
* minor fixes and added pdf print optimized test
* added pdf and pdf print fixtures
* refactor lib function name
* Update difference thresholds
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Discover] Fix field filters test
* Change the fixture for the test
* Fix discover fixture
* Remove empty line
* Restore after
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Replacing EuiPopover with EuiComboBox
* The combobox will help alleviate issues when the list of options is very long
* Refactoring the Combobox to listen for change events
* Added an onChange handler
* Renamed the method to render the combobox
* Commented out additional blocks of code before final refactor
* Finished refactoring the Request Selector to use EUI Combobox
* Removed three helper methods for the EUIPopover.
* `togglePopover()`
* `closePopover()`
* `renderRequestDropdownItem()`
* Removed the local state object and interface (no longer needed)
* Renamed the const `options` to `selectedOptions` in `handleSelectd()`
method to better reflect where the options array was coming from.
* Updating tests and translations
* Fixed the inspector functional test to use comboBox service
* Removed two unused translations
* Updating Combobox options to pass data-test-sub string
* Updated two tests for Combobox single option
* Updated the test expectations to the default string
* Both tests were looking for a named string instead of a default
message
* Adding error handling to Inspector combobox
* Checking for the item status code
* Adding a " (failed)" message if the status code returns `2`
* Updating test to look for "Chart_data" instead of "Chartdata"
* Updating two tests to validate single combobox options
* Added helper method to check default text against combobox options
* Added helper method to get the selected combobox option
* Checking two inspector instances using helpers
* Adding a defensive check to helper method.
* Correct a type error in test return
* Adding back translated failLabel
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nathan L Smith <smith@nlsmith.com>
Co-authored-by: Trevor Pierce <1Copenut@users.noreply.github.com>
Co-authored-by: Nathan L Smith <smith@nlsmith.com>
* Persist hide chart to local storage
* [Discover] Persist hide chart option to local storage
* Fix state
* Fix dependency check
* Set chart state to undefined
* Update unit test
* Do not override saved search preferences
* Fix missing import
* Add a functional test
* Add a functional test
* Fix functional test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This PR fixes bugs in test services, where retry.waitForWithTimeout and find.descendantExistsByCssSelector do not time out correctly.
Co-authored-by: Robert Oskamp <robert.oskamp@elastic.co>
* [Fleet] Add language clients (#113666)
* Apply suggestions from code review
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
* Update src/plugins/custom_integrations/server/plugin.test.ts
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
* Update src/plugins/custom_integrations/server/plugin.test.ts
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Thomas Neirynck <thomas@elastic.co>
Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
* test if 2s sleep fixes flakey test
* switch from sleep to retry.waitFor
* remove .only, add comments to config file about sample data add/remove
* refactor a11y tests for sample data load
* refactor a11y tests for sample data load
* cleanup comments
* cleanup comments
* fix eslint errors
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Lee Drengenberg <lee.drengenberg@elastic.co>
* add `coreOverall$` to internal status contract (#113729)
* add coreOverall$ to internal status contract
* add unit tests
* re-patch flaky tests
* add and improve tests
* fix tests for 7.x
Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
* [Discover] redirect to main page on route not found discover error
* [Discover] remove services from dependencies
* [Discover] apply suggestions
* [Discover] return invalid link, but make it not clickable
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dmitry Tomashevich <39378793+Dmitriynj@users.noreply.github.com>
* [Dashboard] Adding timelion panel without asking for the index pattern
* Adds a functional test
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>