Skip to content

Commit

Permalink
[Discover] Unskip and stabilize ESQL request count test (#206207)
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal authored Jan 13, 2025
1 parent a1f8532 commit b625221
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions test/functional/apps/discover/group3/_request_counts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);
await kibanaServer.uiSettings.replace({
defaultIndex: 'logstash-*',
'bfetch:disable': true,
enableESQL: true,
});
await timePicker.setDefaultAbsoluteRangeViaUiSettings();
await common.navigateToApp('discover');
await header.waitUntilLoadingHasFinished();
});

after(async () => {
Expand Down Expand Up @@ -114,14 +111,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expectedRefreshRequest?: number;
}) => {
it(`should send no more than ${expectedRequests} search requests (documents + chart) on page load`, async () => {
await browser.refresh();
if (type === 'ese') {
await browser.refresh();
}
await browser.execute(async () => {
performance.setResourceTimingBufferSize(Number.MAX_SAFE_INTEGER);
});
await waitForLoadingToFinish();
// one more requests for fields in ESQL mode
const actualExpectedRequests = type === 'esql' ? expectedRequests + 1 : expectedRequests;
await expectSearchCount(type, actualExpectedRequests);
if (type === 'esql') {
await expectSearches(type, expectedRequests, async () => {
await queryBar.clickQuerySubmitButton();
});
} else {
await expectSearchCount(type, expectedRequests);
}
});

it(`should send no more than ${expectedRequests} requests (documents + chart) when refreshing`, async () => {
Expand Down Expand Up @@ -173,9 +175,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
log.debug('Clearing saved search');
await expectSearches(
type,
type === 'esql' ? actualExpectedRequests + 2 : actualExpectedRequests,
type === 'esql' ? actualExpectedRequests + 1 : actualExpectedRequests,
async () => {
await testSubjects.click('discoverNewButton');
if (type === 'esql') {
await queryBar.clickQuerySubmitButton();
}
await waitForLoadingToFinish();
}
);
Expand Down Expand Up @@ -256,21 +261,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
});
});
// 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', () => {
describe('ES|QL mode', () => {
const type = 'esql';
before(async () => {
await kibanaServer.uiSettings.update({
'discover:searchOnPageLoad': false,
});
await common.navigateToApp('discover');
await header.waitUntilLoadingHasFinished();
await discover.selectTextBaseLang();
});

beforeEach(async () => {
await monacoEditor.setCodeEditorValue('from logstash-* | where bytes > 1000 ');
await queryBar.clickQuerySubmitButton();
await waitForLoadingToFinish();
});

getSharedTests({
Expand Down

0 comments on commit b625221

Please sign in to comment.