[9.0] [ES|QL] Fixes the field controls FT flakiness (#216747) (#216981)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[ES|QL] Fixes the field controls FT flakiness
(#216747)](https://github.com/elastic/kibana/pull/216747)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2025-04-02T13:31:48Z","message":"[ES|QL]
Fixes the field controls FT flakiness (#216747)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/216398\n\nI also stabilized the
values FT as it was also flaky 🤞 \n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"cf289cbd1e18a3b0798d00f866e446ce3753d8e9","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:ES|QL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL]
Fixes the field controls FT
flakiness","number":216747,"url":"https://github.com/elastic/kibana/pull/216747","mergeCommit":{"message":"[ES|QL]
Fixes the field controls FT flakiness (#216747)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/216398\n\nI also stabilized the
values FT as it was also flaky 🤞 \n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"cf289cbd1e18a3b0798d00f866e446ce3753d8e9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216747","number":216747,"mergeCommit":{"message":"[ES|QL]
Fixes the field controls FT flakiness (#216747)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/216398\n\nI also stabilized the
values FT as it was also flaky 🤞 \n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"cf289cbd1e18a3b0798d00f866e446ce3753d8e9"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/216837","number":216837,"state":"MERGED","mergeCommit":{"sha":"0ccb82963a0987926370cb9eae212270c361838f","message":"[8.x]
[ES|QL] Fixes the field controls FT flakiness (#216747) (#216837)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`8.x`:\n- [[ES|QL] Fixes the field controls FT
flakiness\n(#216747)](https://github.com/elastic/kibana/pull/216747)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Stratoula Kalafateli <efstratia.kalafateli@elastic.co>"}}]}] BACKPORT-->
This commit is contained in:
Stratoula Kalafateli 2025-04-03 14:45:36 +02:00 committed by GitHub
parent de2f174ab5
commit 7ce4926655
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 7 deletions

View file

@ -46,6 +46,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await dashboardAddPanel.clickEditorMenuButton();
await dashboardAddPanel.clickAddNewPanelFromUIActionLink('ES|QL');
await dashboard.waitForRenderComplete();
await elasticChart.setNewChartUiDebugFlag(true);
await retry.try(async () => {
const panelCount = await dashboard.getPanelCount();
@ -87,13 +88,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
it('should update the Lens chart accordingly', async () => {
await elasticChart.setNewChartUiDebugFlag(true);
// change the control value
await comboBox.set('esqlControlValuesDropdown', 'clientip');
await dashboard.waitForRenderComplete();
const data = await elasticChart.getChartDebugData('xyVisChart');
expect(data?.axes?.x[0]?.title).to.be('clientip');
await retry.try(async () => {
const data = await elasticChart.getChartDebugData('xyVisChart');
expect(data?.axes?.x[0]?.title).to.be('clientip');
});
});
});
}

View file

@ -14,11 +14,12 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const kibanaServer = getService('kibanaServer');
const { dashboard, timePicker, common, dashboardControls } = getPageObjects([
const { dashboard, timePicker, common, dashboardControls, header } = getPageObjects([
'dashboard',
'timePicker',
'common',
'dashboardControls',
'header',
]);
const find = getService('find');
const testSubjects = getService('testSubjects');
@ -26,6 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const dashboardAddPanel = getService('dashboardAddPanel');
const browser = getService('browser');
const comboBox = getService('comboBox');
const dashboardPanelActions = getService('dashboardPanelActions');
describe('dashboard - add an value type ES|QL control', function () {
before(async () => {
@ -87,18 +89,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const editorValue = await esql.getEsqlEditorQuery();
expect(editorValue).to.contain('FROM logstash-* | WHERE geo.dest == ?geo_dest');
await testSubjects.click('applyFlyoutButton');
await dashboard.waitForRenderComplete();
});
it('should update the Lens chart accordingly', async () => {
// now edit the panel and click on Cancel
await dashboardPanelActions.clickInlineEdit();
// change the table to keep only the column with the control
await esql.setEsqlEditorQuery(
'FROM logstash-* | WHERE geo.dest == ?geo_dest | KEEP geo.dest'
);
// run the query
await testSubjects.click('ESQLEditor-run-query-button');
await dashboard.waitForRenderComplete();
await header.waitUntilLoadingHasFinished();
// save the changes
await testSubjects.click('applyFlyoutButton');
});
it('should update the Lens chart accordingly', async () => {
await dashboard.waitForRenderComplete();
await header.waitUntilLoadingHasFinished();
// change the control value
await comboBox.set('esqlControlValuesDropdown', 'AO');
await dashboard.waitForRenderComplete();