Skip to content

[9.2] [Synthetics] Fix useSyntheticsRules test (#247259)#247285

Merged
kibanamachine merged 3 commits intoelastic:9.2from
kibanamachine:backport/9.2/pr-247259
Dec 22, 2025
Merged

[9.2] [Synthetics] Fix useSyntheticsRules test (#247259)#247285
kibanamachine merged 3 commits intoelastic:9.2from
kibanamachine:backport/9.2/pr-247259

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 9.2:

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 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 f4cca33 into elastic:9.2 Dec 22, 2025
13 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @cesco-f

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