Skip to content

Commit

Permalink
[RAM] Fix maintenance window scoped query functional test (elastic#17…
Browse files Browse the repository at this point in the history
…2625)

## Summary
Resolves: elastic#172571

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
  • Loading branch information
JiaweiWu authored Dec 6, 2023
1 parent 6ee47b0 commit 2fcae2c
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ export default function maintenanceWindowScopedQueryTests({ getService }: FtrPro
});

// Ensure we wrote the new maintenance window ID to the alert doc
const result = await es.search<Alert>({
index: alertAsDataIndex,
body: { query: { match_all: {} } },
});
await retry.try(async () => {
const result = await es.search<Alert>({
index: alertAsDataIndex,
body: { query: { match_all: {} } },
});

expect(result.hits.hits[0]?._source?.[ALERT_MAINTENANCE_WINDOW_IDS]).eql([
maintenanceWindow.id,
]);
expect(result.hits.hits[0]?._source?.[ALERT_MAINTENANCE_WINDOW_IDS]).eql([
maintenanceWindow.id,
]);
});

await runSoon({
id: rule.id,
Expand Down

0 comments on commit 2fcae2c

Please sign in to comment.