mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[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)](https://github.com/elastic/kibana/pull/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":"matthias.wilhelm@elastic.co"},"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 <matthias.wilhelm@elastic.co>
This commit is contained in:
parent
c36b3c0c5c
commit
1e6f754b35
1 changed files with 31 additions and 26 deletions
|
@ -28,8 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const log = getService('log');
|
||||
const retry = getService('retry');
|
||||
|
||||
// Failing: See https://github.com/elastic/kibana/issues/205344
|
||||
describe.skip('discover request counts', function describeIndexTests() {
|
||||
describe('discover request counts', function describeIndexTests() {
|
||||
before(async function () {
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash');
|
||||
|
@ -54,30 +53,34 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
const expectSearchCount = async (type: 'ese' | 'esql', searchCount: number) => {
|
||||
await retry.try(async () => {
|
||||
if (searchCount === 0) {
|
||||
await browser.execute(async () => {
|
||||
performance.clearResourceTimings();
|
||||
});
|
||||
}
|
||||
await waitForLoadingToFinish();
|
||||
const endpoint = type === 'esql' ? `${type}_async` : type;
|
||||
const requests = await browser.execute(() =>
|
||||
performance
|
||||
.getEntries()
|
||||
.filter((entry: any) => ['fetch', 'xmlhttprequest'].includes(entry.initiatorType))
|
||||
);
|
||||
await retry.tryWithRetries(
|
||||
`expect ${type} request to match count ${searchCount}`,
|
||||
async () => {
|
||||
if (searchCount === 0) {
|
||||
await browser.execute(async () => {
|
||||
performance.clearResourceTimings();
|
||||
});
|
||||
}
|
||||
await waitForLoadingToFinish();
|
||||
const endpoint = type === 'esql' ? `${type}_async` : type;
|
||||
const requests = await browser.execute(() =>
|
||||
performance
|
||||
.getEntries()
|
||||
.filter((entry: any) => ['fetch', 'xmlhttprequest'].includes(entry.initiatorType))
|
||||
);
|
||||
|
||||
const result = requests.filter((entry) =>
|
||||
entry.name.endsWith(`/internal/search/${endpoint}`)
|
||||
);
|
||||
const result = requests.filter((entry) =>
|
||||
entry.name.endsWith(`/internal/search/${endpoint}`)
|
||||
);
|
||||
|
||||
const count = result.length;
|
||||
if (count !== searchCount) {
|
||||
log.warning('Request count differs:', result);
|
||||
}
|
||||
expect(count).to.be(searchCount);
|
||||
});
|
||||
const count = result.length;
|
||||
if (count !== searchCount) {
|
||||
log.warning('Request count differs:', result);
|
||||
}
|
||||
expect(count).to.be(searchCount);
|
||||
},
|
||||
{ retryCount: 5, retryDelay: 500 }
|
||||
);
|
||||
};
|
||||
|
||||
const waitForLoadingToFinish = async () => {
|
||||
|
@ -257,8 +260,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('ES|QL mode', () => {
|
||||
// Currently ES|QL checks are disabled due to various flakiness
|
||||
// Note that ES|QL also checks for different number of requests due to the fields request triggered
|
||||
// by the ES|QL Editor
|
||||
describe.skip('ES|QL mode', () => {
|
||||
const type = 'esql';
|
||||
before(async () => {
|
||||
await common.navigateToApp('discover');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue