Improve instrumentation test reliability with Compose waitUntil#170
Merged
Conversation
…zation Use Compose Test Rule's waitUntil() instead of Thread.sleep() throughout UIWorkflowTest to improve test reliability and reduce flakiness. This approach waits for actual UI state changes rather than arbitrary delays. - Replace all Thread.sleep calls with composeTestRule.waitUntil() - Wait for dialogs to appear/disappear using semantic node checks - Wait for button enabled/disabled state changes - Increase assertModelResponseNotEmpty timeout to 10 seconds
Tests that check for "t/s" metrics or "Successfully loaded" text could get false positives from previous test runs' chat history. This adds a clearChatHistory() helper that navigates to settings and clicks Clear Chat History before tests that rely on detecting new generation output.
lucylq
reviewed
Jan 22, 2026
| private const val RESPONSE_TAG = "LLAMA_RESPONSE" | ||
| private const val DEFAULT_MODEL_FILE = "stories110M.pte" | ||
| private const val DEFAULT_TOKENIZER_FILE = "tokenizer.model" | ||
| private const val DEFAULT_TOKENIZER_FILE = "stories.model" |
Contributor
Author
There was a problem hiding this comment.
Not correct. Added more
lucylq
approved these changes
Jan 22, 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.
Replace Thread.sleep calls with Compose's waitUntil for proper test synchronization, eliminating race conditions
Remove "Please Select a Model" popup dialog in favor of a system message in chat
Remove "Delete Chat History" confirmation dialog for streamlined UX
Add clearChatHistory() helper to ensure clean test state between tests
Fix various test timing issues by using proper Compose testing APIs