Fix flaky instrumentation tests, Compose timeouts, and NPE crashes#540
Open
temcguir wants to merge 6 commits into
Open
Fix flaky instrumentation tests, Compose timeouts, and NPE crashes#540temcguir wants to merge 6 commits into
temcguir wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors several UI and camera system tests, adjusting timeouts, replacing forEach loops with standard for loops, and splitting the capture events channel in PreviewViewModel into incoming and outgoing channels. Feedback focuses on buffering the outgoing capture events channel to prevent potential deadlocks, simplifying semantics node checks in ComposeTestRuleExt.kt, removing redundant and unidiomatic 'val unused' assignments, and using Kotlin's native @Suppress annotation instead of Java's @SuppressWarnings.
temcguir
force-pushed
the
temcguir/fix-timeouts-and-crashes
branch
from
July 15, 2026 00:11
03f6350 to
1946e34
Compare
added 4 commits
July 15, 2026 00:12
…ension, fix annotation, and run spotless
…es for ErrorProne warnings
temcguir
force-pushed
the
temcguir/fix-timeouts-and-crashes
branch
2 times, most recently
from
July 15, 2026 00:17
04c048c to
27ac92c
Compare
temcguir
force-pushed
the
temcguir/fix-timeouts-and-crashes
branch
from
July 15, 2026 01:42
27ac92c to
202769b
Compare
Collaborator
|
/gemini review |
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
davidjiagoogle
approved these changes
Jul 23, 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.
This pull request introduces several stability fixes for Jetpack Camera App's instrumentation tests, which previously suffered from intermittent timeouts and crashes when running on emulators.
Changes:
PreviewViewModel: Events from the zero-capacity_captureEventsRendezvous Channel were previously being blocked if consumed rapidly. We've split the event pipeline into_incomingCaptureEvents(anUNLIMITEDcapacity channel) and_outgoingCaptureEventsto cleanly bridge the events from theCaptureControllerto the Compose UI. This resolvesComposeTimeoutExceptionflakes in Snackbar assertions and test runners.DEFAULT_TIMEOUT_MILLISinUiTestUtil.ktfrom 5 seconds to 15 seconds. This provides enough buffer for slower emulators transitioning back to the capture screen inCaptureModeSettingsTestwithout artificially flaking.instrumentation.context.applicationContextwithinstrumentation.targetContext.applicationContextinsideCameraXCameraSystemTest. This resolves a 100% reproducibleNullPointerExceptionduring test initialization.PreviewViewModel.