-
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
[Discover] Fix flaky cell actions tests #202097
Merged
davismcphee
merged 8 commits into
elastic:main
from
davismcphee:fix-flaky-cell-actions-tests
Dec 3, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
351e02b
Attempt to fix flaky cell actions tests
davismcphee f4269d2
Merge branch 'main' into fix-flaky-cell-actions-tests
davismcphee 25e272f
Attempt to keep profile resets in sync
davismcphee 6c68149
Fix types and tests, remove temp code
davismcphee 984bc38
Remove comment
davismcphee 2213f43
Remove addLog
davismcphee b53f68a
Merge branch 'main' into fix-flaky-cell-actions-tests
davismcphee 1a611db
Merge branch 'main' into fix-flaky-cell-actions-tests
davismcphee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The issue was that there is a 100ms delay between when we update the app state data source to the new data view in
changeDataView
(and trigger default state reset) and when thefetch$
callback is actually called (due to the debounce ingetFetch$
). If within that 100ms period, the previous fetch finishes, this code was being run and clearing out the default state reset here:kibana/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts
Lines 314 to 320 in 2213f43
This causes the following code which checks for the default state reset in the
fetch$
callback to receive allfalse
values for the subsequent fetch, and the correct default state does not get set:kibana/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts
Lines 268 to 271 in 2213f43
The solution was to ensure the default state reset call associated with this fetch is actually the latest one when this code is run, by using a
resetId
that gets updated on each reset call. This is not the most elegant solution to this issue and is a symptom of a deeper issue, but it was the least invasive one I could come up with. I believe the long term / correct solution to this issue is to refactor Discover data fetching so logic runs sequentially and is easier to reason about.