-
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] Attempt to fix onDataViewEdited flakiness by resetting dataStateContainer #199982
Conversation
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
/ci |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7391[✅] test/functional/apps/discover/group3/config.ts: 25/25 tests passed. |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7395[✅] test/functional/apps/discover/group3/config.ts: 100/100 tests passed. |
/ci |
/ci |
const prevInternalDataViews = this.internalDataViews; | ||
|
||
this.internalDataViews = uniqBy(indexPatterns, 'id'); | ||
// making sure to not run into the race condition that the data source has the previous data view id | ||
// causing to throw an exception that's not necessary | ||
this.internalDataViews = uniqBy([...indexPatterns, ...prevInternalDataViews], 'id'); |
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.
I don't know if we can commit it this way, but it appears to resolve the race condition in the manual testing, that never happened in CI (in combination with the other small adaptation of this PR, because just this adaptation doesn't resolve it completely ).
Manual testing (copyright @jughosta)
Steps to reproduce the error:
- Install all sample data.
- On Discover page, create an ad hoc data view kib* with @timetamp as the time field. Edit data view and set timestamp as the time field. Edit again and remove the time field. Edit again and set timestamp as the time field.
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.
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.
I think both cases apply, previous id can't be found, and new id can't be found 😿
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.
I observed that in
kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts
Line 474 in 5fa46ca
const missingIds = currentDatasource.checkIntegrity(currentDatasourceState.state, indexPatterns); |
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.
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.
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.
That's a great finding! I will take a look, thanks!
/ci |
💔 Build Failed
Failed CI StepsHistory
cc @kertal |
Closing in favor of #200687 |
Summary
fixes #184600
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers