Skip to content

test: log uncaught exceptions in the demo smoke tests - #1071

Open
kikoso wants to merge 1 commit into
mainfrom
test/smoke-log-uncaught-exceptions
Open

kikoso wants to merge 1 commit into
mainfrom
test/smoke-log-uncaught-exceptions

Conversation

@kikoso

@kikoso kikoso commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up of #1070. DemoAppSmokeTest and DemoMenuNavigationTest replace the default uncaught exception handler with one that only records the exception, so it can be asserted at the end. If the main thread throws, though, the app does not crash: the main thread just stops, the test hangs waiting for it and never reaches assertNoUncaughtExceptions(), and the exception is lost.

  • Both handlers now also log the exception with Log.e under the DemoSmokeTest tag, with the thread name. Behaviour of the tests does not change.
  • AGENTS.md explains to keep the screen on when running the emulator suites on a physical device (adb shell svc power stayon usb), since a screen timeout in the middle of a run made the demo app hang with an ANR on a Pixel 4, and to check logcat for the DemoSmokeTest tag if a run hangs.

Testing

  • DemoAppSmokeTest with requireMapLoaded=true on a Pixel 4 (Android 13) with the screen kept on: 44 of 44 pass, nothing logged by the handler.
  • maps-app instrumentation tests compile and spotlessKotlinCheck passes.

Closes #1070

The smoke tests replace the default uncaught exception handler with one that
only records the exception. If the main thread throws, the app hangs instead of
crashing and the test may never reach assertNoUncaughtExceptions(), so the
exception was lost. Log it under the DemoSmokeTest tag as well.

Also note in AGENTS.md to keep the screen on when running the emulator suites
on a physical device: a screen timeout in the middle of a run made the demo app
hang with an ANR (#1070).
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Coverage (unit tests)

Compared against 174f0fd on main (#1060).

Module Line % Change Branch % Change
maps-compose 15.28% no change 3.76% no change
maps-compose-utils 6.09% no change 4.47% no change
maps-compose-widgets 10.88% no change 11.11% no change
TOTAL 12.99% no change 4.12% no change

Line and branch coverage from unit test reports. History is recorded on the coverage-history branch after each merge to main.

@googlemaps-bot

Copy link
Copy Markdown
Contributor

Coverage (instrumentation tests)

Overall Project 43.59% 🍏

There is no coverage information present for the Files changed

This branch has not been deployed

No deployments
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.

MapsInLazyColumnActivity hangs the demo app in DemoAppSmokeTest on a Pixel 4 (Android 13)

3 participants