Commit c9d158b
authored
Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/task_runner·ts - alerting api integration security and spaces enabled Alerts - Group 1 alerts backfill rule runs ad hoc backfill task should run all execution sets of a scheduled backfill and correctly generate alerts (#195768)
Fixes #192144
## Summary
This flakiness is occurring due to the time of the test run. We create a
pre-timestamped set of documents and run a backfill job over them using
`startOf(now - X days)`
For example, our documents have these timestamps:
```
"2024-09-25T23:51:24.793Z",
// should be in the first execution
"2024-09-26T00:10:00.000Z",
"2024-09-26T00:11:00.000Z",
"2024-09-26T00:12:00.000Z",
// should be in the second execution
"2024-09-27T00:20:00.000Z",
// should be in the third execution
"2024-09-28T00:30:00.000Z",
"2024-09-28T00:31:00.000Z",
"2024-09-28T00:32:00.000Z",
"2024-09-28T00:33:00.000Z",
"2024-09-28T00:34:00.000Z",
// should be in the fifth execution
"2024-09-30T00:40:00.000Z",
"2024-09-30T00:41:00.000Z"
```
and our scheduled backfill job should run from
`2024-09-26T00:00:00.000Z` to `2024-10-01T00:00:00.000Z` but because
test ran right around midnight UTC, the job actually ends up being
scheduled with a start of `2024-09-27T00:00:00.000Z`.
This PR fixes this flakiness by basing the start of the backfill job to
directly use one of the generated doc timestamps1 parent 930f861 commit c9d158b
1 file changed
Lines changed: 1 addition & 1 deletion
File tree
- x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
0 commit comments