Skip to content

[RUM-14471] Fix flaky AppStartupActivityPredicateTest#3218

Merged
hamorillo merged 1 commit into
developfrom
hector.morilloprieto/RUM-14471-flaky-test
Mar 4, 2026
Merged

[RUM-14471] Fix flaky AppStartupActivityPredicateTest#3218
hamorillo merged 1 commit into
developfrom
hector.morilloprieto/RUM-14471-flaky-test

Conversation

@hamorillo

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a race condition in AppStartupActivityPredicateTest introduced in #3199. Applies the same CountDownLatch + ActivityLifecycleCallbacks pattern already used in AppStartupAutoForwardTest and AppStartupAsyncAutoForwardingTest to ensure the test waits for MainContentActivity to reach RESUMED before asserting RUM events.

Motivation

The test was flaky because InterstitialSplashActivity immediately starts and finishes synchronously, so MainContentActivity could reach RESUMED before runInstrumentationScenario began checking — causing the 60s ConditionWatcher to time out with the underlying assertion never satisfied.

Additional Notes

No production code changes. Test-only fix following the existing pattern in the same package.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

…nContentActivity resume

Apply the same CountDownLatch/ActivityLifecycleCallbacks pattern used in other startup
tests to eliminate the race condition where MainContentActivity reaches RESUMED before
the test begins asserting RUM events.
@datadog-official

This comment has been minimized.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.45%. Comparing base (091844a) to head (0ae17b8).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3218      +/-   ##
===========================================
- Coverage    71.46%   71.45%   -0.01%     
===========================================
  Files          934      934              
  Lines        34628    34628              
  Branches      5862     5862              
===========================================
- Hits         24745    24742       -3     
- Misses        8238     8244       +6     
+ Partials      1645     1642       -3     

see 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hamorillo
hamorillo marked this pull request as ready for review March 4, 2026 14:56
@hamorillo
hamorillo requested review from a team as code owners March 4, 2026 14:56
@hamorillo
hamorillo merged commit ba162fa into develop Mar 4, 2026
27 checks passed
@hamorillo
hamorillo deleted the hector.morilloprieto/RUM-14471-flaky-test branch March 4, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants