Skip to content

Commit 1e6f754

Browse files
[8.x] [Discover] Unskip functional discover request counts test and skip ES|QL part (#205690) (#205993)
# Backport This will backport the following commits from `main` to `8.x`: - [[Discover] Unskip functional discover request counts test and skip ES|QL part (#205690)](#205690) <!--- 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":"2025-01-09T05:35:40Z","message":"[Discover] Unskip functional discover request counts test and skip ES|QL part (#205690)\n\nUnskipping the main test, and unskipping the `ES|QL` part due to flakiness","sha":"cbcb24e036dd598cc4109fdb83ebdb5bcaba2d4c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor"],"title":"[Discover] Unskip functional discover request counts test and skip ES|QL part","number":205690,"url":"https://github.com/elastic/kibana/pull/205690","mergeCommit":{"message":"[Discover] Unskip functional discover request counts test and skip ES|QL part (#205690)\n\nUnskipping the main test, and unskipping the `ES|QL` part due to flakiness","sha":"cbcb24e036dd598cc4109fdb83ebdb5bcaba2d4c"}},"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/205690","number":205690,"mergeCommit":{"message":"[Discover] Unskip functional discover request counts test and skip ES|QL part (#205690)\n\nUnskipping the main test, and unskipping the `ES|QL` part due to flakiness","sha":"cbcb24e036dd598cc4109fdb83ebdb5bcaba2d4c"}}]}] BACKPORT--> Co-authored-by: Matthias Wilhelm <[email protected]>
1 parent c36b3c0 commit 1e6f754

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

test/functional/apps/discover/group3/_request_counts.ts

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
2828
const log = getService('log');
2929
const retry = getService('retry');
3030

31-
// Failing: See https://github.com/elastic/kibana/issues/205344
32-
describe.skip('discover request counts', function describeIndexTests() {
31+
describe('discover request counts', function describeIndexTests() {
3332
before(async function () {
3433
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
3534
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash');
@@ -54,30 +53,34 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
5453
});
5554

5655
const expectSearchCount = async (type: 'ese' | 'esql', searchCount: number) => {
57-
await retry.try(async () => {
58-
if (searchCount === 0) {
59-
await browser.execute(async () => {
60-
performance.clearResourceTimings();
61-
});
62-
}
63-
await waitForLoadingToFinish();
64-
const endpoint = type === 'esql' ? `${type}_async` : type;
65-
const requests = await browser.execute(() =>
66-
performance
67-
.getEntries()
68-
.filter((entry: any) => ['fetch', 'xmlhttprequest'].includes(entry.initiatorType))
69-
);
56+
await retry.tryWithRetries(
57+
`expect ${type} request to match count ${searchCount}`,
58+
async () => {
59+
if (searchCount === 0) {
60+
await browser.execute(async () => {
61+
performance.clearResourceTimings();
62+
});
63+
}
64+
await waitForLoadingToFinish();
65+
const endpoint = type === 'esql' ? `${type}_async` : type;
66+
const requests = await browser.execute(() =>
67+
performance
68+
.getEntries()
69+
.filter((entry: any) => ['fetch', 'xmlhttprequest'].includes(entry.initiatorType))
70+
);
7071

71-
const result = requests.filter((entry) =>
72-
entry.name.endsWith(`/internal/search/${endpoint}`)
73-
);
72+
const result = requests.filter((entry) =>
73+
entry.name.endsWith(`/internal/search/${endpoint}`)
74+
);
7475

75-
const count = result.length;
76-
if (count !== searchCount) {
77-
log.warning('Request count differs:', result);
78-
}
79-
expect(count).to.be(searchCount);
80-
});
76+
const count = result.length;
77+
if (count !== searchCount) {
78+
log.warning('Request count differs:', result);
79+
}
80+
expect(count).to.be(searchCount);
81+
},
82+
{ retryCount: 5, retryDelay: 500 }
83+
);
8184
};
8285

8386
const waitForLoadingToFinish = async () => {
@@ -257,8 +260,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
257260
});
258261
});
259262
});
260-
261-
describe('ES|QL mode', () => {
263+
// Currently ES|QL checks are disabled due to various flakiness
264+
// Note that ES|QL also checks for different number of requests due to the fields request triggered
265+
// by the ES|QL Editor
266+
describe.skip('ES|QL mode', () => {
262267
const type = 'esql';
263268
before(async () => {
264269
await common.navigateToApp('discover');

0 commit comments

Comments
 (0)