Commit f94d8d9
fix(replay): Fix flaky ComposeMaskingOptionsTest unmask assertion
The `when sentry-unmask modifier is set unmasks the node` test intermittently
failed because Robolectric can report zero bounds for some nodes when running
the full test class, making them invisible (shouldMask = isVisible && ...).
Restructure the test to:
- Explicitly find the "Make Request" node and assert it IS visible and unmasked
- Assert other visible nodes remain masked, with a guard against empty iteration
- Tolerate intermittent zero-bounds on non-identifiable nodes (Robolectric artifact)
Validated with the repro from getsentry/repro#51: 20/20 passes (vs ~10% flake
rate before the fix).
Fixes #5585
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ec5e3a5 commit f94d8d9
1 file changed
Lines changed: 17 additions & 11 deletions
File tree
- sentry-android-replay/src/test/java/io/sentry/android/replay/viewhierarchy
Lines changed: 17 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
242 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
| |||
0 commit comments