-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Wait for visualizations to render in tests #21258
Conversation
💚 Build Succeeded |
💚 Build Succeeded |
code LGTM jenkins, test this |
💚 Build Succeeded |
💚 Build Succeeded |
} | ||
vis = visualizations[0]; | ||
} | ||
await retry.tryForTime(10000, async () => { |
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 10000 is the default so you could just do:
await retry.try(async () => {..
return await sharedItem.getAttribute('data-render-complete'); | ||
const sharedItems = await this.getPanelSharedItemData(); | ||
await Promise.all(sharedItems.map(async sharedItem => { | ||
return await visualization.waitForRender(sharedItem.element, sharedItem.title, { ignoreNonVisualization: true }); |
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 this might be a lot slower than the previous implementation. The element being passed in here, I don't think is the element with the TEST_SUBJECT_VISUALIZE
on it, so for every panel on the dashboard, it's going to call testSubjects.findAllDescendant(TEST_SUBJECT_VISUALIZE, parentElement);
. All the findAll*
functions are really slow and should be avoided where possible.
I could be wrong though...
Could you maybe create a waitForAllToRender
function that instead of looking for a single visualization, just always does:
const visualizations = await testSubjects.findAllDescendant(TEST_SUBJECT_VISUALIZE, bodyElement);
then loops through them all and waits for 'data-loading'
attribute to go away?
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.
Actually it IS that element (why I needed to change the function to also accept the element itself and not just look in its descendant) :-) Would you still want it to changed in that case?
Jenkins, test this |
💚 Build Succeeded |
💚 Build Succeeded |
Jenkins, test this |
💚 Build Succeeded |
jenkins, test this |
💔 Build Failed |
Jenkins, test this - hit #19743 flaky test |
💚 Build Succeeded |
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.
for the record, spoke to Tim offline and gave lgtm prior to merge. I have some suggestions to go on top of it but will experiment with those separately so as not to hold this up.
* Wait for visualizations to render * Use Visualize.waitForRender on dashboard * Enable previously flaky dashboard tests again * Add data-loading for initial render * Remove unnecessary timeout
Looks like this did not fix the flakiness for the dashboard filtering test - #21375 (comment) |
This PR introduces a new
data-loading
attribute while rendering visualizations and wait for that attribute in tests for actually not just waiting for the data loading to finish (whatPageObjects.header.waitUntilLoadingHasFinished
does), but also for the visualization to have signaled that it's done loading.cc @stacey-gammon @ppisljar @liza-mae @LeeDr