assertOnUiThread asserts in the sample app test
Categories
(Data Platform and Tools :: Glean: SDK, defect, P3)
Tracking
(Not tracked)
People
(Reporter: janerik, Unassigned)
Details
(Whiteboard: [telemetry:glean-rs:m?])
For some reason our assertOnUiThread in Glean.kt and MetricsPingScheduler fails when the sample app is run as part of the instrumentation tests.
I assume the "main thread" is not the same as the UI thread in that test environment for some reason.
Reporter | ||
Comment 1•6 years ago
|
||
So the getMainLooper
thread is indeed different than the one Glean gets run on: currentThreadId: 310, expectedThreadId: 2
No idea why though.
Comment 2•6 years ago
|
||
We could probably skip the check if in testing mode, hackish though that is. I also wonder if we can getting away with skipping registering lifecycle handlers in test mode...
Reporter | ||
Comment 3•6 years ago
|
||
This applies to the connectedAndroidTests
which IMO and at best should not run in test mode (they currently do) and, as I think, the app is launched once without being in test mode.
We can't skip lifecycle handlers to begin with because that's exactly what these tests are testing.
Reporter | ||
Comment 4•6 years ago
|
||
Doesn't apply anymore after https://github.com/mozilla/glean/pull/393 and https://github.com/mozilla-mobile/android-components/pull/4786
Description
•