-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover] Unskip functional discover request counts test and skip ES|QL part #205690
Changes from all commits
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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}`, | ||||||||||
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.
Suggested change
Nit: If these fail in the future, the logs won't include the received count. Not a big deal, but could be worth defining 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. I think
and since the expect in the try function hasn't change, there should be no problem here? I think it's
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. I was suggesting to include |
||||||||||
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'); | ||||||||||
|
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've rewrote this part, because it's simpler for debugging. when starting this test, going to get a coffee,
tryWithRetries
failes earlier thantry
. And it makes no sense here to wait too long