Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with flaky sample data API integration test (elastic#165328)
## Summary Closes; - elastic#164568 - elastic#121883 ## Context; This issue is caused by inconsistencies in timestamp format existing in the [sample data for flights](https://github.com/elastic/kibana/blob/8.10/src/plugins/home/server/services/sample_data/data_sets/flights/flights.json.gz). See screenshot; <img width="1020" alt="Screenshot 2023-09-06 at 09 45 18" src="https://github.com/elastic/kibana/assets/7893459/e358eb2d-dc92-4e0d-b697-e362e2dbd33b"> When the flight sample data is being installed, on encountering any one of these data points with a timestamp that's not a valid representation for a date ISOString, it results in the [computation of a value](https://github.com/elastic/kibana/blame/v8.9.1/src/plugins/home/server/services/sample_data/lib/translate_timestamp.ts#L46) that can not be parsed as a valid date, this is verifiable taking a look at the result of a failed flaky test run [here](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3037#018a5164-27e7-45d9-897c-56f34fe2bfc3/288-1243) logging the documents returned that the test would run against, one would note that the timestamp value for the first document is `2000-01-15T` which computes to `NaN` when parsed which further cascades into other parts of the test, causing it to fail eventually. This PR removes the data points with the invalid timestamps and modifies the tests to match the new expectation for the number of documents that should have been indexed. This change set was also ran through the [flaky test runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3077) with success. ### 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
- Loading branch information