-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fixed indice assertion to loop through expected keys #64684
Fixed indice assertion to loop through expected keys #64684
Conversation
… are contained within the array. Also made sure that the two arrays have the same length. Those two assertions should make sure that the contents are the same no matter the order of the keys.
… are contained within the array. Also made sure that the two arrays have the same length. Those two assertions should make sure that the contents are the same no matter the order of the keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on @cuff-links! I have a concern and a suggested solution.
x-pack/test/api_integration/apis/management/index_management/indices.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM! Can we also update the similar test here: https://github.com/cuff-links/kibana/blob/Fixed_Indice_Assertion_To_Loop_Through_Expected_Keys/x-pack/test/api_integration/apis/management/index_management/indices.js#L229
x-pack/test/api_integration/apis/management/index_management/indices.js
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
…f github.com:cuff-links/kibana into Fixed_Indice_Assertion_To_Loop_Through_Expected_Keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM!
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* master: (42 commits) fix SavedObjectMigrationMap type (elastic#65569) [Uptime] Improve cert flaky test (elastic#65458) [Uptime] Fix monitor list result runtime type, ip can be null (elastic#65532) [APM] Agent configuration: Bug makes it possible to create invalid configurations (elastic#65508) [APM] Remove link from active page in the breadcrumb (elastic#65473) [SIEM] Fixes test flakiness (elastic#65510) [ESLint] update @kbn/eslint/no-restricted-paths rule to allow imports mocks from folder (elastic#65471) Migrate test plugins ⇒ NP (kbn_tp_run_pipeline) (elastic#64780) move core provier to NP. allows to run tests on every page (elastic#64929) Extended alerting documentation with information about using Kibana keystore and action types for preconfigured connectors (elastic#65201) [functional tests] add some missing awaits (elastic#65566) Fixed create new connector from alert flyout form throw an error messages in external plugins. (elastic#65539) [SIEM] [Cases] External services not getting all comments bug fix (elastic#65307) Migrate Coordinate Maps to NP (elastic#64668) Updating Canvas location in nav (elastic#65519) [SIEM][Lists] Fixes up contracts to work outside of requests [Lens] Remove "inside only" option for treemap labels (elastic#65363) [Uptime] Add TLS alert functional test (elastic#65303) Fix z-index of kbnLoadingIndicator (elastic#65521) Fixed indice assertion to loop through expected keys (elastic#64684) ...
* Changed assertion to loop through expected keys and confirm that they are contained within the array. Also made sure that the two arrays have the same length. Those two assertions should make sure that the contents are the same no matter the order of the keys. * Changed assertion to loop through expected keys and confirm that they are contained within the array. Also made sure that the two arrays have the same length. Those two assertions should make sure that the contents are the same no matter the order of the keys. * Fixed typo in function. * Changed assertion per conversation. * Updated assertion on second test. * Fixed assertion for equality that's not strict. * Added comment to code to explain why the arrays were sorted. Co-authored-by: Elastic Machine <[email protected]>
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
2 similar comments
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
* Changed assertion to loop through expected keys and confirm that they are contained within the array. Also made sure that the two arrays have the same length. Those two assertions should make sure that the contents are the same no matter the order of the keys. * Changed assertion to loop through expected keys and confirm that they are contained within the array. Also made sure that the two arrays have the same length. Those two assertions should make sure that the contents are the same no matter the order of the keys. * Fixed typo in function. * Changed assertion per conversation. * Updated assertion on second test. * Fixed assertion for equality that's not strict. * Added comment to code to explain why the arrays were sorted. Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
This PR closes #64473.
Problem
Race condition causes the indices to be added to the array of indices in different orders every time.
Solution
Iterate through the expected keys and make sure they are in contained in the array. Also verify that the array lengths are the same.