Skip to content

Commit 038f286

Browse files
authored
[8.18] [Infra] Add retry to url assert (elastic#224126) (elastic#233630)
# Backport This will backport the following commits from `main` to `8.18`: - [[Infra] Add retry to url assert (elastic#224126)](elastic#224126) <!--- Backport version: 10.0.0 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Carlos Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-17T17:21:17Z","message":"[Infra] Add retry to url assert (elastic#224126)\n\nfixes [elastic#192882](https://github.com/elastic/kibana/issues/192882)","sha":"012761e80c1e863ee93115c129de1c0959d4007f","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-infra_services","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0","v9.0.3"],"title":"[Infra] Add retry to url assert","number":224126,"url":"https://github.com/elastic/kibana/pull/224126","mergeCommit":{"message":"[Infra] Add retry to url assert (elastic#224126)\n\nfixes [elastic#192882](https://github.com/elastic/kibana/issues/192882)","sha":"012761e80c1e863ee93115c129de1c0959d4007f"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.18","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/224313","number":224313,"state":"MERGED","mergeCommit":{"sha":"eaa52d69fea3d287d5f8a6e027a6447f9a1c0e97","message":"[9.0] [Infra] Add retry to url assert (elastic#224126) (elastic#224313)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.0`:\n- [[Infra] Add retry to url assert\n(elastic#224126)](https://github.com/elastic/kibana/pull/224126)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Carlos Crespo <[email protected]>"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224126","number":224126,"mergeCommit":{"message":"[Infra] Add retry to url assert (elastic#224126)\n\nfixes [elastic#192882](https://github.com/elastic/kibana/issues/192882)","sha":"012761e80c1e863ee93115c129de1c0959d4007f"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
1 parent f4e23fa commit 038f286

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

x-pack/test/functional/apps/infra/metrics_anomalies.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ import { HOSTS_VIEW_PATH, ML_JOB_IDS } from './constants';
1212
export default ({ getPageObjects, getService }: FtrProviderContext) => {
1313
const esArchiver = getService('esArchiver');
1414
const kibanaServer = getService('kibanaServer');
15-
const pageObjects = getPageObjects(['assetDetails', 'common', 'infraHome', 'infraHostsView']);
15+
const pageObjects = getPageObjects([
16+
'assetDetails',
17+
'common',
18+
'infraHome',
19+
'infraHostsView',
20+
'header',
21+
]);
1622
const infraSourceConfigurationForm = getService('infraSourceConfigurationForm');
1723
const testSubjects = getService('testSubjects');
1824
const browser = getService('browser');
25+
const retry = getService('retry');
1926

2027
describe('Metrics UI Anomaly Flyout', function () {
2128
before(async () => {
@@ -144,10 +151,14 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
144151
await pageObjects.infraHome.setAnomaliesDate('Apr 21, 2021 @ 00:00:00.000');
145152
const hostName = await pageObjects.infraHome.getAnomalyHostName();
146153
await pageObjects.infraHome.clickShowAffectedHostsButton();
147-
const currentUrl = await browser.getCurrentUrl();
148-
expect(currentUrl).to.contain(
149-
encodeURIComponent(`query:(terms:(host.name:!(${hostName})))`)
150-
);
154+
await pageObjects.header.waitUntilLoadingHasFinished();
155+
156+
await retry.tryForTime(5000, async () => {
157+
const currentUrl = await browser.getCurrentUrl();
158+
expect(currentUrl).to.contain(
159+
encodeURIComponent(`query:(terms:(host.name:!(${hostName})))`)
160+
);
161+
});
151162
});
152163
});
153164
});

0 commit comments

Comments
 (0)