Repository navigation
Conversation
Coverage (unit tests)No unit baseline recorded in
Line and branch coverage from unit test reports. History is recorded in |
…dering BaseVisualTest.waitForMapRendering previously hardcoded a 3-second UI wait and clamped its sleep to at most 5 seconds, causing VisualMapSampleTest to flake on cold CI emulators when map tiles had not finished loading. Replace the blind sleep with pixel-based map-readiness and frame-stabilization polling that honors the full timeoutSeconds budget, returns early once rendered tiles settle, and updates VisualMapSampleTest to use the 30-second default timeout.
d5fc37e to
08a85cf
Compare
android-emulator-runner executes each line of `script` in its own `sh -c`, so the multi-line if/fi block failed with "Syntax error: end of file unexpected (expecting "fi")" after connectedAndroidTest had passed, and `status` was never carried between lines. Collapse the diagnostics into one line that keeps the Gradle exit status, always prints the filtered logcat (BaseVisualTest settle/timeout messages, Maps authorization errors) and only saves the full logcat on failure.
The Maps SDK logs the API key in plain text on authorization failures. Secret masking covers the job log but not the uploaded emulator-logcat.txt artifact, so redact AIza keys from both the filtered and the full logcat before printing or saving them.
| val deadlineMillis = startMillis + totalTimeoutMillis | ||
|
|
||
| // Wait for the Google Map accessibility node to appear within the full timeout budget | ||
| uiDevice.wait(Until.hasObject(By.descContains("Google Map")), totalTimeoutMillis) |
There was a problem hiding this comment.
Being the result of uiDevice.wait ignored, if the map has no "Google Map" description we now spend the whole 30s here and then return without any settle check (before it was 3s + 5s). Could we check the result and fall back to the full screen, or at least log which node we didn't find?
| } catch (_: InterruptedException) { | ||
| Thread.currentThread().interrupt() | ||
| } |
There was a problem hiding this comment.
nit: after restoring the flag, every following Thread.sleep throws directly, so the loop takes screenshots without pause until the deadline. What about stopping the wait here?
| } catch (_: InterruptedException) { | |
| Thread.currentThread().interrupt() | |
| } | |
| } catch (e: InterruptedException) { | |
| Thread.currentThread().interrupt() | |
| throw IllegalStateException("Interrupted while waiting for map rendering", e) | |
| } |
kikoso
left a comment
There was a problem hiding this comment.
LGTM! I pushed two small fixes for the logcat step: each line of script runs in its own shell, so the if/fi block was failing even with the tests green, and the API keys are now redacted (the Maps SDK logs them on authorization failures, and the uploaded artifact is not masked). Should we keep this step now, or is still temporary as the commit says?
Summary
Fixes intermittent
VisualMapSampleTest.verifyStoreLocatorMapRenderingflakes on cold CI emulators where Gemini Vision saw a blank/unloaded Google Map surface.Root Cause
BaseVisualTest.waitForMapRendering(timeoutSeconds)hardcoded a 3-second UI hierarchy wait and clamped its blind sleep totimeoutSeconds.coerceAtMost(5)without verifying that map tiles had actually drawn. On software-rendered CI emulators (swiftshader_indirect), Play Services Maps initialization and initial tile fetches can exceed 5 seconds.Changes
MapRenderingReadiness(internal) to sample the inset interior of the map bounds, distinguishing rendered tiles/overlays from blank or loading-grid surfaces and verifying frame stabilization across consecutive polls.BaseVisualTest.waitForMapRendering(timeoutSeconds)to honor the fulltimeoutSecondsbudget and return early as soon as map content renders and settles (no public API signature changes).VisualMapSampleTestto use the 30-second defaultwaitForMapRendering().MapRenderingReadinessTest.Verification
./gradlew spotlessApply test lint spotlessCheck apiCheck docs:dokkaGeneratepassed.