-
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] Unskip Discover-Lens functional test suite #200687
Conversation
/ci |
if ( | ||
dataView.id && | ||
(dataView.id !== visContext.requestData.dataViewId || | ||
(!dataView.isPersisted() && !lensProps.attributes.state.adHocDataViews?.[dataView.id])) | ||
) { | ||
// to prevent a race condition when the data view changes id | ||
// the ids of the data view and the lens props and visContextDataView should be the same | ||
// console.log('flakydebugging', { | ||
// dataViewId: dataView.id, | ||
// visContextDataViewId: visContext.requestData.dataViewId, | ||
// lensProps: lensProps.attributes.references.find((r) => r.id === dataView.id), | ||
// }); | ||
|
||
return <></>; | ||
} |
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.
So, this seems to prevent the history to fail, because we have different data views in different props that are passed into the Lens embeddable. Ideally this should be caught on a higher level, so this kind of situation can't happen. So just display a loading state until props are aligned
However, if this resolves the race condition, it's now clear what's causing it.
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.
Let's unskip the test suite and run the flaky test runner too.
I was not able to reproduce the dave view error on this branch!
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.
Wow! Thx! This is great news!
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.
Also, another update to tests would be necessary once you unskip them as in e9d5c25
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.
tests are green, and flaky test runner too
/ci |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7427[✅] test/functional/apps/discover/group3/config.ts: 25/25 tests passed. |
@@ -204,6 +230,10 @@ export function Histogram({ | |||
} | |||
`; | |||
|
|||
if (!checkValidDataViewConfig(dataView, visContext, lensProps.attributes.state.adHocDataViews)) { | |||
return <></>; |
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.
@jughosta do we have an alternative here? we need to prevent the rendering for the flaky case, should we render something, given we move forward with this PR (it woulld need to be investigated or refactored later on, since the given state causing the flakiness ideally should not happen)
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 have an alternative right now. What I've tried was causing other test failures and extra fetches. So let's go with your solution.
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.
Ok, so we should open an issue to remove this code, given we resolve the root cause, which might be a bigger refactoring
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
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, @kertal!
This comment was marked as outdated.
This comment was marked as outdated.
Starting backport for target branches: 8.15, 8.16, 8.x |
Catching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped. (cherry picked from commit e082cd1)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
…#201013) # Backport This will backport the following commits from `main` to `8.x`: - [[Discover] Unskip Discover-Lens functional test suite (#200687)](#200687) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Matthias Wilhelm","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-20T17:38:05Z","message":"[Discover] Unskip Discover-Lens functional test suite (#200687)\n\nCatching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.","sha":"e082cd1dfaa79c6fdfc5d7f1d2842b6ca0a5db6c","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-major"],"title":"[Discover] Unskip Discover-Lens functional test suite ","number":200687,"url":"https://github.com/elastic/kibana/pull/200687","mergeCommit":{"message":"[Discover] Unskip Discover-Lens functional test suite (#200687)\n\nCatching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.","sha":"e082cd1dfaa79c6fdfc5d7f1d2842b6ca0a5db6c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200687","number":200687,"mergeCommit":{"message":"[Discover] Unskip Discover-Lens functional test suite (#200687)\n\nCatching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.","sha":"e082cd1dfaa79c6fdfc5d7f1d2842b6ca0a5db6c"}}]}] BACKPORT--> Co-authored-by: Matthias Wilhelm <[email protected]>
Catching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped. (cherry picked from commit e082cd1) # Conflicts: # test/functional/apps/discover/group3/_lens_vis.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Catching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped. (cherry picked from commit e082cd1) # Conflicts: # src/plugins/unified_histogram/public/chart/histogram.tsx # test/functional/apps/discover/group3/_lens_vis.ts
#201076) # Backport This will backport the following commits from `main` to `8.16`: - [[Discover] Unskip Discover-Lens functional test suite (#200687)](#200687) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Matthias Wilhelm","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-20T17:38:05Z","message":"[Discover] Unskip Discover-Lens functional test suite (#200687)\n\nCatching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.","sha":"e082cd1dfaa79c6fdfc5d7f1d2842b6ca0a5db6c","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-major","v8.17.0"],"number":200687,"url":"https://github.com/elastic/kibana/pull/200687","mergeCommit":{"message":"[Discover] Unskip Discover-Lens functional test suite (#200687)\n\nCatching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.","sha":"e082cd1dfaa79c6fdfc5d7f1d2842b6ca0a5db6c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200687","number":200687,"mergeCommit":{"message":"[Discover] Unskip Discover-Lens functional test suite (#200687)\n\nCatching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.","sha":"e082cd1dfaa79c6fdfc5d7f1d2842b6ca0a5db6c"}},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/201013","number":201013,"state":"MERGED","mergeCommit":{"sha":"e2c0c94b52a4fe3486a0e85b84e9856821c27afc","message":"[8.x] [Discover] Unskip Discover-Lens functional test suite (#200687) (#201013)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.x`:\n- [[Discover] Unskip Discover-Lens functional test suite\n(#200687)](https://github.com/elastic/kibana/pull/200687)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Matthias\nWilhelm\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-11-20T17:38:05Z\",\"message\":\"[Discover]\nUnskip Discover-Lens functional test suite (#200687)\\n\\nCatching an\ninvalid state of properties propagated to the UnifiedHistogram which is\nusing the Lens embeddable in Discover, that causes a rendering error\nwhen e.g. ad hoc data views are being edited. Therefore the skipped\ntestview can be\nunskipped.\",\"sha\":\"e082cd1dfaa79c6fdfc5d7f1d2842b6ca0a5db6c\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.17.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"Feature:Discover\",\"release_note:skip\",\"v9.0.0\",\"Team:DataDiscovery\",\"backport:prev-major\"],\"title\":\"[Discover]\nUnskip Discover-Lens functional test suite\n\",\"number\":200687,\"url\":\"https://github.com/elastic/kibana/pull/200687\",\"mergeCommit\":{\"message\":\"[Discover]\nUnskip Discover-Lens functional test suite (#200687)\\n\\nCatching an\ninvalid state of properties propagated to the UnifiedHistogram which is\nusing the Lens embeddable in Discover, that causes a rendering error\nwhen e.g. ad hoc data views are being edited. Therefore the skipped\ntestview can be\nunskipped.\",\"sha\":\"e082cd1dfaa79c6fdfc5d7f1d2842b6ca0a5db6c\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/200687\",\"number\":200687,\"mergeCommit\":{\"message\":\"[Discover]\nUnskip Discover-Lens functional test suite (#200687)\\n\\nCatching an\ninvalid state of properties propagated to the UnifiedHistogram which is\nusing the Lens embeddable in Discover, that causes a rendering error\nwhen e.g. ad hoc data views are being edited. Therefore the skipped\ntestview can be\nunskipped.\",\"sha\":\"e082cd1dfaa79c6fdfc5d7f1d2842b6ca0a5db6c\"}}]}]\nBACKPORT-->\n\nCo-authored-by: Matthias Wilhelm <[email protected]>"}}]}] BACKPORT-->
was not backported to 8.15 since it was not skipped there |
This PR didn't make it into the latest BC of v8.16.1. Updating the labels. |
Catching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.
Catching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.
Catching an invalid state of properties propagated to the UnifiedHistogram which is using the Lens embeddable in Discover, that causes a rendering error when e.g. ad hoc data views are being edited. Therefore the skipped testview can be unskipped.
Summary
Fixes #184600
The PR catches propagating an invalid state of properties to the Lens embeddable, that causes this error, when e.g. ad hoc data views are being edited causing the following error when rendering the histogram in Discover:
Note: this midigates and catches an invalid state, that we ideally should catch before it happens, but the current approach fixes the problem, but we should to refactor this to stabilize and ideally simplify.
Testing
There was a reliable way to run into this error before this PR:
This caused the histogram to fail, but this should no longer be the case
Checklist