-
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
fixing flaky vsualize data_table_nontimeindex test #22288
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -393,19 +393,25 @@ export function VisualizePageProvider({ getService, getPageObjects }) { | |
|
||
// clickBucket(bucketType) 'X-Axis', 'Split Area', 'Split Chart' | ||
async clickBucket(bucketName) { | ||
const chartTypes = await retry.try( | ||
async () => await find.allByCssSelector('li.list-group-item.list-group-menu-item')); | ||
log.debug('found bucket types ' + chartTypes.length); | ||
|
||
async function getChartType(chart) { | ||
const chartString = await chart.getVisibleText(); | ||
if (chartString === bucketName) { | ||
await chart.click(); | ||
await PageObjects.common.sleep(500); | ||
await retry.try(async () => { | ||
const chartTypes = await retry.try( | ||
async () => await find.allByCssSelector('li.list-group-item.list-group-menu-item')); | ||
log.debug('found bucket types ' + chartTypes.length); | ||
|
||
async function getChartType(chart) { | ||
const chartString = await chart.getVisibleText(); | ||
if (chartString === bucketName) { | ||
await chart.click(); | ||
await PageObjects.common.sleep(500); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We cannot rely on a timer to be sure that the click is executed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what would be your suggestion ? anyway, i would keep that out of this PR ... in general i think we want to remove every sleep in our tests with something more reliable. |
||
return true; | ||
} | ||
} | ||
} | ||
const getChartTypesPromises = chartTypes.map(getChartType); | ||
await Promise.all(getChartTypesPromises); | ||
const getChartTypesPromises = chartTypes.map(getChartType); | ||
const clickResult = await Promise.all(getChartTypesPromises); | ||
if (!clickResult.some(result => result === true)) { | ||
throw new Error(`bucket ${bucketName} not found`); | ||
} | ||
}); | ||
} | ||
|
||
async selectAggregation(myString, groupName = 'buckets', childAggregationType = null) { | ||
|
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 we need to find a better selector than this one, it's also used on the metric list. I know that we then heve a check on the name, but it's not the right way to get this.
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 agree, but would probably keep this PR to the minimal change.