Fixed
Status Update
Comments
cc...@google.com <cc...@google.com> #2
Yigit, do you have time to fix it?
reemission of the same liveData is racy
reemission of the same liveData is racy
yi...@google.com <yi...@google.com> #3
yea i'll take it.
cc...@google.com <cc...@google.com>
ap...@google.com <ap...@google.com> #4
Thanks for the detailed analysis. This may not be an issue anymore since we've started using Main.immediate there but I' not sure; I'll try to create a test case.
na...@google.com <na...@google.com> #5
just emitting same live data reproduces the issue.
@Test
fun raceTest() {
val subLiveData = MutableLiveData(1)
val subject = liveData(testScope.coroutineContext) {
emitSource(subLiveData)
emitSource(subLiveData) //crashes
}
subject.addObserver().apply {
testScope.advanceUntilIdle()
}
}
@Test
fun raceTest() {
val subLiveData = MutableLiveData(1)
val subject = liveData(testScope.coroutineContext) {
emitSource(subLiveData)
emitSource(subLiveData) //crashes
}
subject.addObserver().apply {
testScope.advanceUntilIdle()
}
}
Description
Component used: Studio Dolphin Beta 05
Versions used: Macrobenchmark 1.1.0
Devices/Android versions reproduced on: Pixel 3 API 31, SM-F926B API 31
System trace allows to investigate janky frames in studio/perfetto on SDK >= 31. When a system trace is recorded manually (from studio) on a profileable app, it gives information on various phases - App, GPU, Composition (see screenshot).
When the system trace is recorded with the Macrobenchmark, it still gives the janky frames, but the phases are unavailable (see screenshot).
Can we query for this kind of data as well?