Skip to content

Commit 19eb51e

Browse files
[9.1] [Synthetics] Fixed flaky test (#226367) (#226402)
# Backport This will backport the following commits from `main` to `9.1`: - [[Synthetics] Fixed flaky test (#226367)](#226367) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Francesco Fagnani","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T11:51:06Z","message":"[Synthetics] Fixed flaky test (#226367)\n\nThis PR closes #221290 by fixing the flaky test.","sha":"354db50240dfe362ded89ce18829c7a5ea274bfa","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0","author:obs-ux-management","v9.2.0"],"title":"[Synthetics] Fixed flaky test","number":226367,"url":"https://github.com/elastic/kibana/pull/226367","mergeCommit":{"message":"[Synthetics] Fixed flaky test (#226367)\n\nThis PR closes #221290 by fixing the flaky test.","sha":"354db50240dfe362ded89ce18829c7a5ea274bfa"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226367","number":226367,"mergeCommit":{"message":"[Synthetics] Fixed flaky test (#226367)\n\nThis PR closes #221290 by fixing the flaky test.","sha":"354db50240dfe362ded89ce18829c7a5ea274bfa"}}]}] BACKPORT--> Co-authored-by: Francesco Fagnani <[email protected]>
1 parent fdfee52 commit 19eb51e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

x-pack/solutions/observability/test/api_integration/apis/synthetics/sync_global_params.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ export const LOCAL_LOCATION = {
3333
};
3434

3535
export default function ({ getService }: FtrProviderContext) {
36-
// FLAKY: https://github.com/elastic/kibana/issues/221290
37-
// Failing: See https://github.com/elastic/kibana/issues/221290
38-
describe.skip('SyncGlobalParams', function () {
36+
describe('SyncGlobalParams', function () {
3937
this.tags('skipCloud');
4038
const supertestAPI = getService('supertest');
4139
const kServer = getService('kibanaServer');
@@ -138,6 +136,7 @@ export default function ({ getService }: FtrProviderContext) {
138136
[ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id,
139137
[ConfigKey.CONFIG_ID]: apiResponse.body.id,
140138
locations: [LOCAL_LOCATION, pvtLoc],
139+
spaces: ['default'],
141140
})
142141
);
143142
newMonitorId = apiResponse.rawBody.id;
@@ -174,6 +173,13 @@ export default function ({ getService }: FtrProviderContext) {
174173
.set('kbn-xsrf', 'true')
175174
.send({ key: 'test', value: 'http://proxy.com' });
176175

176+
/*
177+
* Creating a global parameter kicks off an asynchronous background task.
178+
* We pause for 5 seconds to let that task finish before creating monitors that reference the param;
179+
* if it’s still running when the monitor is added, Kibana would not schedule a second sync task.
180+
*/
181+
await new Promise((resolve) => setTimeout(resolve, 5000));
182+
177183
expect(apiResponse.status).eql(200);
178184
});
179185

@@ -237,6 +243,7 @@ export default function ({ getService }: FtrProviderContext) {
237243
[ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id,
238244
[ConfigKey.CONFIG_ID]: apiResponse.body.id,
239245
locations: [LOCAL_LOCATION, pvtLoc],
246+
spaces: ['default'],
240247
})
241248
);
242249
newHttpMonitorId = apiResponse.rawBody.id;

0 commit comments

Comments
 (0)