Skip to content

[9.3] [Synthetics] Fix useSyntheticsRules test (#247259)#247286

Merged
kibanamachine merged 1 commit intoelastic:9.3from
kibanamachine:backport/9.3/pr-247259
Dec 22, 2025
Merged

[9.3] [Synthetics] Fix useSyntheticsRules test (#247259)#247286
kibanamachine merged 1 commit intoelastic:9.3from
kibanamachine:backport/9.3/pr-247259

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 9.3:

Questions ?

Please refer to the Backport tool documentation

### Summary
Fixes a timing-based flaky test failure in
`use_synthetics_rules.test.tsx`.

### Problem
The test assertions were comparing full action objects including
`meta.dispatchedAt` timestamps. Since the timestamp is generated at call
time, there's a small time difference between when the hook dispatches
the action and when the test generates a new action for comparison,
causing intermittent failures:

### Solution
Use `expect.objectContaining()` with `expect.any(Number)` to validate
the action structure without requiring an exact timestamp match.

(cherry picked from commit 8ac629e)
@kibanamachine kibanamachine requested a review from a team as a code owner December 22, 2025 16:11
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Dec 22, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) December 22, 2025 16:11
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@kibanamachine kibanamachine merged commit 53462e9 into elastic:9.3 Dec 22, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:obs-ux-management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants