Skip to content

@W-22919604: [Android] Stabilize flaky test loginUrl_UpdatesOn_selectedServerChange#2922

Merged
JohnsonEricAtSalesforce merged 1 commit into
forcedotcom:devfrom
JohnsonEricAtSalesforce:feature/W-22919604_android-stabilize-flaky-test-loginurl-updateson-selectedserverchange
Jun 10, 2026
Merged

@W-22919604: [Android] Stabilize flaky test loginUrl_UpdatesOn_selectedServerChange#2922
JohnsonEricAtSalesforce merged 1 commit into
forcedotcom:devfrom
JohnsonEricAtSalesforce:feature/W-22919604_android-stabilize-flaky-test-loginurl-updateson-selectedserverchange

Conversation

@JohnsonEricAtSalesforce

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace all Thread.sleep calls in LoginViewModelTest with deterministic coroutine control via StandardTestDispatcher + advanceUntilIdle()
  • Add injectable backgroundContext parameter to LoginViewModel (internal, test-only, defaults to Dispatchers.IO)
  • Remove redundant suspend modifier from generateMigrationAuthorizationPath

Test plan

  • All 72 LoginViewModelTest tests pass on local emulator
  • Target test (loginUrl_UpdatesOn_selectedServerChange) passes 10/10 runs locally
  • Firebase Test Lab CI passes (6 consecutive successful runs with zero failures)

This PR description was posted by an AI agent on behalf of @JohnsonEricAtSalesforce.

…edServerChange (Replace Thread.sleep with test dispatcher)
* [server] and [migrationOAuthConfig].
*/
internal suspend fun generateMigrationAuthorizationPath(
internal fun generateMigrationAuthorizationPath(

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by cleanup: Android Studio flagged this as a redundant suspend modifier — the function body contains no suspension points.


This comment was posted by an AI agent on behalf of @JohnsonEricAtSalesforce.

@JohnsonEricAtSalesforce

Copy link
Copy Markdown
Contributor Author

CI Verification: The previously flaky test was validated with 6 consecutive successful runs on Firebase Test Lab (via gh run rerun), all passing without failure. This confirms the fix eliminates the timing-dependent flakiness.


This comment was posted by an AI agent on behalf of @JohnsonEricAtSalesforce.

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce merged commit af64936 into forcedotcom:dev Jun 10, 2026
23 checks passed
@JohnsonEricAtSalesforce JohnsonEricAtSalesforce deleted the feature/W-22919604_android-stabilize-flaky-test-loginurl-updateson-selectedserverchange branch June 10, 2026 03:26
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.

2 participants