[Synthetics] Fixed EnableDefaultAlerting test#227779
Merged
cesco-f merged 1 commit intoelastic:mainfrom Jul 15, 2025
Merged
Conversation
Contributor
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#8638[✅] x-pack/solutions/observability/test/api_integration_deployment_agnostic/configs/stateful/oblt.stateful.config.ts: 25/25 tests passed. |
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
|
baileycash-elastic
approved these changes
Jul 14, 2025
Contributor
|
Starting backport for target branches: 8.19, 9.1 https://github.com/elastic/kibana/actions/runs/16285154671 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jul 15, 2025
This PR closes elastic#225448 . `EnableDefaultAlerting` creates a new Fleet agent-policy for every test case. Immediately after each case our `beforeEach` calls `kibanaServer.savedObjects.cleanStandardList()`, which deletes all saved-objects, including `ingest-agent-policies/<id>`. Fleet’s `packagePolicyService.bulkCreate()` is invoked from the Synthetics server when the monitor is saved. Because we call it with `asyncDeploy: true`, Fleet queues the package-policy creation and returns. A few seconds later the background task tries to attach the new synthetics package-policy to the agent-policy ID it received. If we have wiped that saved-object in the meantime the lookup fails. Instead of wiping everything we now remove only the objects that matter for the test in the `beforeEach`. (cherry picked from commit 439d81f)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jul 15, 2025
This PR closes elastic#225448 . `EnableDefaultAlerting` creates a new Fleet agent-policy for every test case. Immediately after each case our `beforeEach` calls `kibanaServer.savedObjects.cleanStandardList()`, which deletes all saved-objects, including `ingest-agent-policies/<id>`. Fleet’s `packagePolicyService.bulkCreate()` is invoked from the Synthetics server when the monitor is saved. Because we call it with `asyncDeploy: true`, Fleet queues the package-policy creation and returns. A few seconds later the background task tries to attach the new synthetics package-policy to the agent-policy ID it received. If we have wiped that saved-object in the meantime the lookup fails. Instead of wiping everything we now remove only the objects that matter for the test in the `beforeEach`. (cherry picked from commit 439d81f)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Jul 15, 2025
# Backport This will backport the following commits from `main` to `9.1`: - [[Synthetics] Fixed EnableDefaultAlerting test (#227779)](#227779) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Francesco Fagnani","email":"fagnani.francesco@gmail.com"},"sourceCommit":{"committedDate":"2025-07-15T05:46:02Z","message":"[Synthetics] Fixed EnableDefaultAlerting test (#227779)\n\nThis PR closes #225448 .\n\n`EnableDefaultAlerting` creates a new Fleet agent-policy for every test\ncase.\nImmediately after each case our `beforeEach` calls\n`kibanaServer.savedObjects.cleanStandardList()`, which deletes all\nsaved-objects, including `ingest-agent-policies/<id>`.\n\nFleet’s `packagePolicyService.bulkCreate()` is invoked from the\nSynthetics server when the monitor is saved.\nBecause we call it with `asyncDeploy: true`, Fleet queues the\npackage-policy creation and returns. A few seconds later the background\ntask tries to attach the new synthetics package-policy to the\nagent-policy ID it received. If we have wiped that saved-object in the\nmeantime the lookup fails.\n\nInstead of wiping everything we now remove only the objects that matter\nfor the test in the `beforeEach`.","sha":"439d81f05af9b117b12cbbbf066a7a628dc0bb37","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.1.0","v8.19.0","author:obs-ux-management","v9.2.0"],"title":"[Synthetics] Fixed EnableDefaultAlerting test","number":227779,"url":"https://github.com/elastic/kibana/pull/227779","mergeCommit":{"message":"[Synthetics] Fixed EnableDefaultAlerting test (#227779)\n\nThis PR closes #225448 .\n\n`EnableDefaultAlerting` creates a new Fleet agent-policy for every test\ncase.\nImmediately after each case our `beforeEach` calls\n`kibanaServer.savedObjects.cleanStandardList()`, which deletes all\nsaved-objects, including `ingest-agent-policies/<id>`.\n\nFleet’s `packagePolicyService.bulkCreate()` is invoked from the\nSynthetics server when the monitor is saved.\nBecause we call it with `asyncDeploy: true`, Fleet queues the\npackage-policy creation and returns. A few seconds later the background\ntask tries to attach the new synthetics package-policy to the\nagent-policy ID it received. If we have wiped that saved-object in the\nmeantime the lookup fails.\n\nInstead of wiping everything we now remove only the objects that matter\nfor the test in the `beforeEach`.","sha":"439d81f05af9b117b12cbbbf066a7a628dc0bb37"}},"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/227779","number":227779,"mergeCommit":{"message":"[Synthetics] Fixed EnableDefaultAlerting test (#227779)\n\nThis PR closes #225448 .\n\n`EnableDefaultAlerting` creates a new Fleet agent-policy for every test\ncase.\nImmediately after each case our `beforeEach` calls\n`kibanaServer.savedObjects.cleanStandardList()`, which deletes all\nsaved-objects, including `ingest-agent-policies/<id>`.\n\nFleet’s `packagePolicyService.bulkCreate()` is invoked from the\nSynthetics server when the monitor is saved.\nBecause we call it with `asyncDeploy: true`, Fleet queues the\npackage-policy creation and returns. A few seconds later the background\ntask tries to attach the new synthetics package-policy to the\nagent-policy ID it received. If we have wiped that saved-object in the\nmeantime the lookup fails.\n\nInstead of wiping everything we now remove only the objects that matter\nfor the test in the `beforeEach`.","sha":"439d81f05af9b117b12cbbbf066a7a628dc0bb37"}}]}] BACKPORT--> Co-authored-by: Francesco Fagnani <fagnani.francesco@gmail.com>
This was referenced Jul 15, 2025
kibanamachine
added a commit
that referenced
this pull request
Jul 15, 2025
# Backport This will backport the following commits from `main` to `8.19`: - [[Synthetics] Fixed EnableDefaultAlerting test (#227779)](#227779) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Francesco Fagnani","email":"fagnani.francesco@gmail.com"},"sourceCommit":{"committedDate":"2025-07-15T05:46:02Z","message":"[Synthetics] Fixed EnableDefaultAlerting test (#227779)\n\nThis PR closes #225448 .\n\n`EnableDefaultAlerting` creates a new Fleet agent-policy for every test\ncase.\nImmediately after each case our `beforeEach` calls\n`kibanaServer.savedObjects.cleanStandardList()`, which deletes all\nsaved-objects, including `ingest-agent-policies/<id>`.\n\nFleet’s `packagePolicyService.bulkCreate()` is invoked from the\nSynthetics server when the monitor is saved.\nBecause we call it with `asyncDeploy: true`, Fleet queues the\npackage-policy creation and returns. A few seconds later the background\ntask tries to attach the new synthetics package-policy to the\nagent-policy ID it received. If we have wiped that saved-object in the\nmeantime the lookup fails.\n\nInstead of wiping everything we now remove only the objects that matter\nfor the test in the `beforeEach`.","sha":"439d81f05af9b117b12cbbbf066a7a628dc0bb37","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.1.0","v8.19.0","author:obs-ux-management","v9.2.0"],"title":"[Synthetics] Fixed EnableDefaultAlerting test","number":227779,"url":"https://github.com/elastic/kibana/pull/227779","mergeCommit":{"message":"[Synthetics] Fixed EnableDefaultAlerting test (#227779)\n\nThis PR closes #225448 .\n\n`EnableDefaultAlerting` creates a new Fleet agent-policy for every test\ncase.\nImmediately after each case our `beforeEach` calls\n`kibanaServer.savedObjects.cleanStandardList()`, which deletes all\nsaved-objects, including `ingest-agent-policies/<id>`.\n\nFleet’s `packagePolicyService.bulkCreate()` is invoked from the\nSynthetics server when the monitor is saved.\nBecause we call it with `asyncDeploy: true`, Fleet queues the\npackage-policy creation and returns. A few seconds later the background\ntask tries to attach the new synthetics package-policy to the\nagent-policy ID it received. If we have wiped that saved-object in the\nmeantime the lookup fails.\n\nInstead of wiping everything we now remove only the objects that matter\nfor the test in the `beforeEach`.","sha":"439d81f05af9b117b12cbbbf066a7a628dc0bb37"}},"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/227779","number":227779,"mergeCommit":{"message":"[Synthetics] Fixed EnableDefaultAlerting test (#227779)\n\nThis PR closes #225448 .\n\n`EnableDefaultAlerting` creates a new Fleet agent-policy for every test\ncase.\nImmediately after each case our `beforeEach` calls\n`kibanaServer.savedObjects.cleanStandardList()`, which deletes all\nsaved-objects, including `ingest-agent-policies/<id>`.\n\nFleet’s `packagePolicyService.bulkCreate()` is invoked from the\nSynthetics server when the monitor is saved.\nBecause we call it with `asyncDeploy: true`, Fleet queues the\npackage-policy creation and returns. A few seconds later the background\ntask tries to attach the new synthetics package-policy to the\nagent-policy ID it received. If we have wiped that saved-object in the\nmeantime the lookup fails.\n\nInstead of wiping everything we now remove only the objects that matter\nfor the test in the `beforeEach`.","sha":"439d81f05af9b117b12cbbbf066a7a628dc0bb37"}}]}] BACKPORT--> Co-authored-by: Francesco Fagnani <fagnani.francesco@gmail.com>
Bluefinger
pushed a commit
to Bluefinger/kibana
that referenced
this pull request
Jul 22, 2025
This PR closes elastic#225448 . `EnableDefaultAlerting` creates a new Fleet agent-policy for every test case. Immediately after each case our `beforeEach` calls `kibanaServer.savedObjects.cleanStandardList()`, which deletes all saved-objects, including `ingest-agent-policies/<id>`. Fleet’s `packagePolicyService.bulkCreate()` is invoked from the Synthetics server when the monitor is saved. Because we call it with `asyncDeploy: true`, Fleet queues the package-policy creation and returns. A few seconds later the background task tries to attach the new synthetics package-policy to the agent-policy ID it received. If we have wiped that saved-object in the meantime the lookup fails. Instead of wiping everything we now remove only the objects that matter for the test in the `beforeEach`.
kertal
pushed a commit
to kertal/kibana
that referenced
this pull request
Jul 25, 2025
This PR closes elastic#225448 . `EnableDefaultAlerting` creates a new Fleet agent-policy for every test case. Immediately after each case our `beforeEach` calls `kibanaServer.savedObjects.cleanStandardList()`, which deletes all saved-objects, including `ingest-agent-policies/<id>`. Fleet’s `packagePolicyService.bulkCreate()` is invoked from the Synthetics server when the monitor is saved. Because we call it with `asyncDeploy: true`, Fleet queues the package-policy creation and returns. A few seconds later the background task tries to attach the new synthetics package-policy to the agent-policy ID it received. If we have wiped that saved-object in the meantime the lookup fails. Instead of wiping everything we now remove only the objects that matter for the test in the `beforeEach`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes #225448 .
EnableDefaultAlertingcreates a new Fleet agent-policy for every test case.Immediately after each case our
beforeEachcallskibanaServer.savedObjects.cleanStandardList(), which deletes all saved-objects, includingingest-agent-policies/<id>.Fleet’s
packagePolicyService.bulkCreate()is invoked from the Synthetics server when the monitor is saved.Because we call it with
asyncDeploy: true, Fleet queues the package-policy creation and returns. A few seconds later the background task tries to attach the new synthetics package-policy to the agent-policy ID it received. If we have wiped that saved-object in the meantime the lookup fails.Instead of wiping everything we now remove only the objects that matter for the test in the
beforeEach.