[8.15] [Infra] services test fix (#187961) (#188312)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Infra] services test fix
(#187961)](https://github.com/elastic/kibana/pull/187961)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-07-15T13:58:10Z","message":"[Infra]
services test fix (#187961)\n\nfixes
[#176967](https://github.com/elastic/kibana/issues/176967)\r\n\r\n##
Summary\r\n\r\nIt seems like the problem here is caused by async
teardowns running\r\nwhile the test is about to
run.\r\n\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6507\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3e863aa8b0a58e88e8b841268458a50abd5b5bc3","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","Team:obs-ux-infra_services","v8.16.0"],"title":"[Infra]
services test
fix","number":187961,"url":"https://github.com/elastic/kibana/pull/187961","mergeCommit":{"message":"[Infra]
services test fix (#187961)\n\nfixes
[#176967](https://github.com/elastic/kibana/issues/176967)\r\n\r\n##
Summary\r\n\r\nIt seems like the problem here is caused by async
teardowns running\r\nwhile the test is about to
run.\r\n\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6507\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3e863aa8b0a58e88e8b841268458a50abd5b5bc3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187961","number":187961,"mergeCommit":{"message":"[Infra]
services test fix (#187961)\n\nfixes
[#176967](https://github.com/elastic/kibana/issues/176967)\r\n\r\n##
Summary\r\n\r\nIt seems like the problem here is caused by async
teardowns running\r\nwhile the test is about to
run.\r\n\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6507\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3e863aa8b0a58e88e8b841268458a50abd5b5bc3"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2024-07-15 17:22:51 +02:00 committed by GitHub
parent 88524f21df
commit ec48c9efcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,8 +20,7 @@ export default function ({ getService }: FtrProviderContext) {
const apmSynthtraceKibanaClient = getService('apmSynthtraceKibanaClient');
const esClient = getService('es');
// Failing: See https://github.com/elastic/kibana/issues/176967
describe.skip('GET /infra/services', () => {
describe('GET /infra/services', () => {
let synthtraceApmClient: ApmSynthtraceEsClient;
const from = new Date(Date.now() - 1000 * 60 * 2).toISOString();
const to = new Date().toISOString();
@ -32,7 +31,9 @@ export default function ({ getService }: FtrProviderContext) {
packageVersion: version,
});
});
after(async () => apmSynthtraceKibanaClient.uninstallApmPackage());
after(async () => {
await apmSynthtraceKibanaClient.uninstallApmPackage();
});
describe('with transactions', () => {
before(async () =>
@ -40,7 +41,9 @@ export default function ({ getService }: FtrProviderContext) {
generateServicesData({ from, to, instanceCount: 3, servicesPerHost: 3 })
)
);
after(async () => synthtraceApmClient.clean());
after(async () => {
await synthtraceApmClient.clean();
});
it('returns no services with no data', async () => {
const filters = JSON.stringify({
@ -103,7 +106,9 @@ export default function ({ getService }: FtrProviderContext) {
generateServicesLogsOnlyData({ from, to, instanceCount: 1, servicesPerHost: 2 })
)
);
after(async () => synthtraceApmClient.clean());
after(async () => {
await synthtraceApmClient.clean();
});
it('should return services with logs only data', async () => {
const filters = JSON.stringify({
'host.name': 'host-0',