Skip to content
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

Conversation

cuff-links
Copy link
Contributor

@cuff-links cuff-links commented Apr 28, 2020

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.

John Dorlus added 2 commits April 28, 2020 14:09
… 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.
@cuff-links cuff-links added release_note:skip Skip the PR/issue when compiling release notes v8.0.0 v7.8 labels Apr 28, 2020
@tylersmalley tylersmalley added v7.8.0 and removed v7.8 labels Apr 29, 2020
Copy link
Contributor

@cjcenizal cjcenizal left a 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.

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cuff-links
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM!

@cjcenizal
Copy link
Contributor

@elasticmachine merge upstream

@cuff-links
Copy link
Contributor Author

@elasticmachine merge upstream

@cuff-links cuff-links merged commit f891a01 into elastic:master May 6, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

gmmorris added a commit to gmmorris/kibana that referenced this pull request May 7, 2020
* 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)
  ...
cuff-links pushed a commit to cuff-links/kibana that referenced this pull request May 8, 2020
* 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]>
@kibanamachine
Copy link
Contributor

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.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 8, 2020
@kibanamachine
Copy link
Contributor

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
@kibanamachine
Copy link
Contributor

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.

@kibanamachine
Copy link
Contributor

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.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 13, 2020
cuff-links pushed a commit that referenced this pull request May 13, 2020
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.8.0 v8.0.0
Projects
None yet
5 participants