Repository navigation
test: wait for the mobile session start in Ctor_AutoSessionTrackingEnabled_StartsSession - #5939
Merged
Merged
Conversation
On iOS and Android, AutoSessionTrackingIntegration leaves the session start to the app lifecycle tracker, which runs it on the main thread (#5863). Ctor_AutoSessionTrackingEnabled_StartsSession asserted right after creating the hub, so it failed whenever the main thread hadn't run the start yet. The test now waits up to 5 seconds for the initial session, then asserts as before. It also disposes the hub, so the tracker's observers don't outlive the test. Fixes #5938 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5939 +/- ##
=======================================
Coverage 77.43% 77.44%
=======================================
Files 546 546
Lines 20053 20053
Branches 3962 3962
=======================================
+ Hits 15529 15531 +2
+ Misses 3659 3658 -1
+ Partials 865 864 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Without an app lifecycle to follow, AutoSessionTrackingIntegration starts the session during Init. The hub test now waits for the mobile start, so this test is what fails if that start moves off the init path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jamescrosswell
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ctor_AutoSessionTrackingEnabled_StartsSessionnow waits for the initial session instead of asserting right after creating the hub. On iOS and Android, #5863 made the app lifecycle tracker start the session on the main thread, so the old assertion raced it. It failed the first pass in about 18% of iOS and 9% of Android device-test jobs. On desktop the session still starts inside the constructor, so the wait returns immediately.I kept the test on mobile because it's the only one that runs the trackers' real
Start(), so it still fails if mobile sessions stop starting. The test also disposes the hub now, so the tracker's observers don't outlive it.Because the hub test now accepts a later start, a new
AutoSessionTrackingIntegrationTestscase checks the desktop path: without a lifecycle tracker, the integration starts the session duringInit.On an iOS simulator, delaying the main-thread start by 300 ms made the old assertion fail every time while the new test passed, and removing the start made the new test fail. On desktop, removing
hub.StartSession()from the integration still fails it.Closes #5938
#skip-changelog