-
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
[Dashboard navigation] Fix flaky test #167896
Conversation
…st' into kibana-fix-links-test
@elasticmachine merge upstream |
Pinging @elastic/kibana-presentation (Team:Presentation) |
@@ -137,7 +137,7 @@ export const DashboardLinkComponent = ({ | |||
|
|||
return loadingDestinationDashboard ? ( | |||
<li id={`${id}--loading`}> | |||
<EuiButtonEmpty size="s" isLoading={true} data-test-subj={`${id}--loading`}> | |||
<EuiButtonEmpty size="s" isLoading={true} data-loading data-test-subj={`${id}--loading`}> |
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.
Hmmm... do we maybe want to make use of the RenderCompleteDispatcher
instead? 🤔 This is how Lens, the image embeddable, and saved searches handle this... But we seem to be pretty inconsistent.
@ThomThomson Any thoughts here? I know we've discussed this before for controls, and we ended up faking these attributes for them as well 😆 So I'm good either way - especially since I imagine this will all be changed as part of the embeddable refactor?
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.
Yeah it looks like it should be pretty straightforward to use the RenderCompleteDispatcher
via the abstract Embeddable. I'm not completely sure how that ends up setting the attribute, but we definitely should be using it. The more consistent we are, the easier it will be to update it all.
This should fix the flaky test. However, we should consider refactoring the LinksComponent in a future PR to handle the dashboard fetching so we are "Lifting state up" rather than having the children components telling the parent when they have finished loading.
…st' into kibana-fix-links-test
onLoading is not necessary since the component load synchronously
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.
Changes LGTM! Nicely updated unit and functional tests. Update to the renderComplete
dispatcher looks good also.
These are now handled by the RenderCompleteDispatcher.
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Fixes elastic#167713 and elastic#169276 ## Summary It appears the dashboard links were not ready (still loading) when the test was trying to click on them. When they finish loading the element was stale, triggering the StaleElement error. This PR calls the RenderCompleteDispatcher on the Links embeddable when all of the child components have finished loading. In a future PR, we should consider re-factoring such that the async dashboard fetching happens in the LinksComponent and the results are passed as props to the DashboardLinkComponents. This would be more React-like. I resisted making that change in this PR so that we can fix the reporting error for v8.11. ## Flaky test runner 🤞 https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3636 --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 513a31f)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.11`: - [[Dashboard navigation] Fix flaky test (#167896)](#167896) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nick Peihl","email":"nick.peihl@elastic.co"},"sourceCommit":{"committedDate":"2023-10-23T19:28:04Z","message":"[Dashboard navigation] Fix flaky test (#167896)\n\nFixes #167713 and #169276\r\n\r\n## Summary\r\n\r\nIt appears the dashboard links were not ready (still loading) when the\r\ntest was trying to click on them. When they finish loading the element\r\nwas stale, triggering the StaleElement error. This PR calls the\r\nRenderCompleteDispatcher on the Links embeddable when all of the child\r\ncomponents have finished loading.\r\n\r\nIn a future PR, we should consider re-factoring such that the async\r\ndashboard fetching happens in the LinksComponent and the results are\r\npassed as props to the DashboardLinkComponents. This would be more\r\nReact-like. I resisted making that change in this PR so that we can fix\r\nthe reporting error for v8.11.\r\n\r\n## Flaky test runner 🤞 \r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3636\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"513a31f83f454fbc83dfe983877620147c982833","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","v8.11.0","v8.12.0"],"number":167896,"url":"https://github.com/elastic/kibana/pull/167896","mergeCommit":{"message":"[Dashboard navigation] Fix flaky test (#167896)\n\nFixes #167713 and #169276\r\n\r\n## Summary\r\n\r\nIt appears the dashboard links were not ready (still loading) when the\r\ntest was trying to click on them. When they finish loading the element\r\nwas stale, triggering the StaleElement error. This PR calls the\r\nRenderCompleteDispatcher on the Links embeddable when all of the child\r\ncomponents have finished loading.\r\n\r\nIn a future PR, we should consider re-factoring such that the async\r\ndashboard fetching happens in the LinksComponent and the results are\r\npassed as props to the DashboardLinkComponents. This would be more\r\nReact-like. I resisted making that change in this PR so that we can fix\r\nthe reporting error for v8.11.\r\n\r\n## Flaky test runner 🤞 \r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3636\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"513a31f83f454fbc83dfe983877620147c982833"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/167896","number":167896,"mergeCommit":{"message":"[Dashboard navigation] Fix flaky test (#167896)\n\nFixes #167713 and #169276\r\n\r\n## Summary\r\n\r\nIt appears the dashboard links were not ready (still loading) when the\r\ntest was trying to click on them. When they finish loading the element\r\nwas stale, triggering the StaleElement error. This PR calls the\r\nRenderCompleteDispatcher on the Links embeddable when all of the child\r\ncomponents have finished loading.\r\n\r\nIn a future PR, we should consider re-factoring such that the async\r\ndashboard fetching happens in the LinksComponent and the results are\r\npassed as props to the DashboardLinkComponents. This would be more\r\nReact-like. I resisted making that change in this PR so that we can fix\r\nthe reporting error for v8.11.\r\n\r\n## Flaky test runner 🤞 \r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3636\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"513a31f83f454fbc83dfe983877620147c982833"}}]}] BACKPORT--> Co-authored-by: Nick Peihl <nick.peihl@elastic.co>
Fixes #167713 and #169276
Summary
It appears the dashboard links were not ready (still loading) when the test was trying to click on them. When they finish loading the element was stale, triggering the StaleElement error. This PR calls the RenderCompleteDispatcher on the Links embeddable when all of the child components have finished loading.
In a future PR, we should consider re-factoring such that the async dashboard fetching happens in the LinksComponent and the results are passed as props to the DashboardLinkComponents. This would be more React-like. I resisted making that change in this PR so that we can fix the reporting error for v8.11.
Flaky test runner 🤞
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3636