Skip to content

Commit 83db285

Browse files
kibanamachineymao1
andauthored
[8.19] Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/platform/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/api_key·ts - alerting api integration security and spaces enabled Alerts - Group 1 alerts backfill rule runs backfill api key invalidation should wait to invalidate API key until backfill for rule is complete (elastic#240339) (elastic#240510)
# Backport This will backport the following commits from `main` to `8.19`: - [Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/platform/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/api_key·ts - alerting api integration security and spaces enabled Alerts - Group 1 alerts backfill rule runs backfill api key invalidation should wait to invalidate API key until backfill for rule is complete (elastic#240339)](elastic#240339) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ying Mao","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-10-24T18:55:48Z","message":"Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/platform/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/api_key·ts - alerting api integration security and spaces enabled Alerts - Group 1 alerts backfill rule runs backfill api key invalidation should wait to invalidate API key until backfill for rule is complete (elastic#240339)\n\nResolves https://github.com/elastic/kibana/issues/225194\n\n## Summary\n\nFlaky because it's testing the contents of the ad hoc run saved object\nafter scheduling a backfill task and assuming all the statuses will be\n`pending` but occasionally, a backfill job will run right away and set\nthe status to `complete`. This is ancillary to the functionality we're\ntesting so updated the check to include both `pending` and `complete`.","sha":"3a32af54b6b07885b062443281ca8445d20f7230","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","backport:version","v9.2.0","v9.3.0","v9.1.6","v8.19.6"],"title":"Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/platform/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/api_key·ts - alerting api integration security and spaces enabled Alerts - Group 1 alerts backfill rule runs backfill api key invalidation should wait to invalidate API key until backfill for rule is complete","number":240339,"url":"https://github.com/elastic/kibana/pull/240339","mergeCommit":{"message":"Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/platform/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/api_key·ts - alerting api integration security and spaces enabled Alerts - Group 1 alerts backfill rule runs backfill api key invalidation should wait to invalidate API key until backfill for rule is complete (elastic#240339)\n\nResolves https://github.com/elastic/kibana/issues/225194\n\n## Summary\n\nFlaky because it's testing the contents of the ad hoc run saved object\nafter scheduling a backfill task and assuming all the statuses will be\n`pending` but occasionally, a backfill job will run right away and set\nthe status to `complete`. This is ancillary to the functionality we're\ntesting so updated the check to include both `pending` and `complete`.","sha":"3a32af54b6b07885b062443281ca8445d20f7230"}},"sourceBranch":"main","suggestedTargetBranches":["9.2","9.1","8.19"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/240339","number":240339,"mergeCommit":{"message":"Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/platform/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/api_key·ts - alerting api integration security and spaces enabled Alerts - Group 1 alerts backfill rule runs backfill api key invalidation should wait to invalidate API key until backfill for rule is complete (elastic#240339)\n\nResolves https://github.com/elastic/kibana/issues/225194\n\n## Summary\n\nFlaky because it's testing the contents of the ad hoc run saved object\nafter scheduling a backfill task and assuming all the statuses will be\n`pending` but occasionally, a backfill job will run right away and set\nthe status to `complete`. This is ancillary to the functionality we're\ntesting so updated the check to include both `pending` and `complete`.","sha":"3a32af54b6b07885b062443281ca8445d20f7230"}},{"branch":"9.1","label":"v9.1.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Ying Mao <[email protected]>
1 parent 93ae295 commit 83db285

File tree

1 file changed

+2
-2
lines changed
  • x-pack/platform/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill

1 file changed

+2
-2
lines changed

x-pack/platform/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/api_key.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default function apiKeyBackfillTests({ getService }: FtrProviderContext)
125125
}
126126

127127
it('should wait to invalidate API key until backfill for rule is complete', async () => {
128-
const start = moment().utc().startOf('day').subtract(13, 'days').toISOString();
128+
const start = moment().utc().startOf('day').subtract(8, 'days').toISOString();
129129
const end = moment().utc().startOf('day').subtract(4, 'day').toISOString();
130130
const spaceId = SuperuserAtSpace1.space.id;
131131

@@ -199,7 +199,7 @@ export default function apiKeyBackfillTests({ getService }: FtrProviderContext)
199199
let currentStart = start;
200200
adHocRun1.schedule.forEach((sched: any) => {
201201
expect(sched.interval).to.eql('12h');
202-
expect(sched.status).to.eql('pending');
202+
expect(['pending', 'complete'].includes(sched.status)).to.be(true);
203203
const runAt = moment(currentStart).add(12, 'hours').toISOString();
204204
expect(sched.runAt).to.eql(runAt);
205205
currentStart = runAt;

0 commit comments

Comments
 (0)