Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initial Coil rendering with graphicsLayer #2283

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

alexvanyo
Copy link
Owner

Fixes #2282

Copy link

codecov bot commented Dec 28, 2024

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
15821 2 15819 0
View the full list of 2 ❄️ flaky tests
com.alexvanyo.composelife.ui.app.action.LoadedCellStatePreviewTests drag_and_drop_works_correctly

Flake rate in main: 24.00% (Passed 19 times, Failed 6 times)

Stack Traces | 0.543s run time
java.lang.AssertionError: expected:<CellStateImpl([(2, 0), (0, 1), (2, 1), (1, 2), (2, 2)])> but was:<null>
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.failNotEquals(Assert.java:835)
	at org.junit.Assert.assertEquals(Assert.java:120)
	at kotlin.test.junit.JUnitAsserter.assertEquals(JUnitSupport.kt:32)
	at kotlin.test.AssertionsKt__AssertionsKt.assertEquals(Assertions.kt:63)
	at kotlin.test.AssertionsKt.assertEquals(Unknown Source)
	at kotlin.test.AssertionsKt__AssertionsKt.assertEquals$default(Assertions.kt:62)
	at kotlin.test.AssertionsKt.assertEquals$default(Unknown Source)
	at com.alexvanyo.composelife.ui.app.action.LoadedCellStatePreviewTests$drag_and_drop_works_correctly$1.invokeSuspend(LoadedCellStatePreviewTests.kt:171)
	at com.alexvanyo.composelife.ui.app.action.LoadedCellStatePreviewTests$drag_and_drop_works_correctly$1.invoke(LoadedCellStatePreviewTests.kt)
	at com.alexvanyo.composelife.ui.app.action.LoadedCellStatePreviewTests$drag_and_drop_works_correctly$1.invoke(LoadedCellStatePreviewTests.kt)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt$runUiTest$1$1.invokeSuspend(BaseUiInjectTest.android.kt:45)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt$runUiTest$1$1.invoke(BaseUiInjectTest.android.kt)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt$runUiTest$1$1.invoke(BaseUiInjectTest.android.kt)
	at com.alexvanyo.composelife.test.BaseInjectTest$runAppTest$1.invokeSuspend(BaseInjectTest.kt:58)
	at com.alexvanyo.composelife.test.BaseInjectTest$runAppTest$1.invoke(BaseInjectTest.kt)
	at com.alexvanyo.composelife.test.BaseInjectTest$runAppTest$1.invoke(BaseInjectTest.kt)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$1.invokeSuspend(TestBuilders.kt:318)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.test.TestDispatcher.processEvent$kotlinx_coroutines_test(TestDispatcher.kt:24)
	at kotlinx.coroutines.test.TestCoroutineScheduler.tryRunNextTaskUnless$kotlinx_coroutines_test(TestCoroutineScheduler.kt:99)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$workRunner$1.invokeSuspend(TestBuilders.kt:327)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at kotlinx.coroutines.test.TestBuildersJvmKt.createTestResult(TestBuildersJvm.kt:10)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:310)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(Unknown Source)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:168)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(Unknown Source)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0$default(TestBuilders.kt:160)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0$default(Unknown Source)
	at com.alexvanyo.composelife.test.BaseInjectTest.runAppTest(BaseInjectTest.kt:50)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt.runUiTest$lambda$0(BaseUiInjectTest.android.kt:44)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt.$r8$lambda$Xb2JZd7Lp-CV1D0kbm0Z781AQnQ(BaseUiInjectTest.android.kt)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt$$ExternalSyntheticLambda0.invoke(D8$$SyntheticClass:0)
	at androidx.compose.ui.test.ComposeUiTest_androidKt$runAndroidComposeUiTest$1.invoke(ComposeUiTest.android.kt:114)
	at androidx.compose.ui.test.ComposeUiTest_androidKt$runAndroidComposeUiTest$1.invoke(ComposeUiTest.android.kt:112)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidComposeUiTestImpl.withDisposableContent(ComposeUiTest.android.kt:585)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1$1$1$1.invoke(ComposeUiTest.android.kt:372)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.withComposeIdlingResource(ComposeUiTest.android.kt:441)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.access$withComposeIdlingResource(ComposeUiTest.android.kt:237)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1$1$1.invoke(ComposeUiTest.android.kt:371)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.withWindowRecomposer(ComposeUiTest.android.kt:415)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.access$withWindowRecomposer(ComposeUiTest.android.kt:237)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1$1.invoke(ComposeUiTest.android.kt:370)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.withTestCoroutines(ComposeUiTest.android.kt:428)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.access$withTestCoroutines(ComposeUiTest.android.kt:237)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1.invoke(ComposeUiTest.android.kt:369)
	at androidx.compose.ui.test.EspressoLink.withStrategy(EspressoLink.android.kt:69)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1.invoke(ComposeUiTest.android.kt:368)
	at androidx.compose.ui.test.IdlingResourceRegistry.withRegistry(IdlingResourceRegistry.jvm.kt:146)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1.invoke(ComposeUiTest.android.kt:367)
	at androidx.compose.ui.test.ComposeRootRegistry.withRegistry(ComposeRootRegistry.android.kt:137)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.runTest(ComposeUiTest.android.kt:366)
	at androidx.compose.ui.test.ComposeUiTest_androidKt.runAndroidComposeUiTest(ComposeUiTest.android.kt:112)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt.runUiTest(BaseUiInjectTest.android.kt:58)
	at com.alexvanyo.composelife.ui.app.action.LoadedCellStatePreviewTests.drag_and_drop_works_correctly(LoadedCellStatePreviewTests.kt:70)
com.alexvanyo.composelife.ui.app.InteractiveCellUniverseTests six_long_line_evolves_correctly_with_step

Flake rate in main: 12.50% (Passed 28 times, Failed 4 times)

Stack Traces | 12.5s run time
java.lang.IllegalArgumentException: Detected multithreaded access to SnapshotStateObserver: previousThreadId=1), currentThread={id=113, name=Instr: com.alexvanyo.composelife.test.InjectTestRunner}. Note that observation on multiple threads in layout/draw is not supported. Make sure your measure/layout/draw for each Owner (AndroidComposeView) is executed on the same thread.
	at androidx.compose.runtime.PreconditionsKt.throwIllegalArgumentException(Preconditions.kt:26)
	at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:646)
	at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:124)
	at androidx.compose.ui.node.OwnerSnapshotObserver.observeSemanticsReads$ui_release(OwnerSnapshotObserver.kt:112)
	at androidx.compose.ui.node.LayoutNode.calculateSemanticsConfiguration(LayoutNode.kt:417)
	at androidx.compose.ui.node.LayoutNode.getSemanticsConfiguration(LayoutNode.kt:408)
	at androidx.compose.ui.semantics.SemanticsNodeKt.SemanticsNode(SemanticsNode.kt:48)
	at androidx.compose.ui.semantics.SemanticsNode.fillOneLayerOfSemanticsWrappers(SemanticsNode.kt:274)
	at androidx.compose.ui.semantics.SemanticsNode.unmergedChildren$ui_release(SemanticsNode.kt:253)
	at androidx.compose.ui.semantics.SemanticsNode.unmergedChildren$ui_release$default(SemanticsNode.kt:245)
	at androidx.compose.ui.semantics.SemanticsNode.mergeConfig(SemanticsNode.kt:515)
	at androidx.compose.ui.semantics.SemanticsNode.getConfig(SemanticsNode.kt:219)
	at androidx.compose.ui.test.OutputKt.printToStringInner(Output.kt:169)
	at androidx.compose.ui.test.OutputKt.printToString(Output.kt:137)
	at androidx.compose.ui.test.OutputKt.printToString$default(Output.kt:135)
	at androidx.compose.ui.test.SemanticsNodeInteraction.fetchOneOrThrow(SemanticsNodeInteraction.kt:197)
	at androidx.compose.ui.test.SemanticsNodeInteraction.fetchOneOrThrow$default(SemanticsNodeInteraction.kt:158)
	at androidx.compose.ui.test.SemanticsNodeInteraction.fetchSemanticsNode(SemanticsNodeInteraction.kt:87)
	at androidx.compose.ui.test.ActionsKt.performTouchInput(Actions.kt:389)
	at androidx.compose.ui.test.AndroidActions.performClickImpl(Actions.android.kt:23)
	at androidx.compose.ui.test.ActionsKt.performClick(Actions.kt:60)
	at com.alexvanyo.composelife.ui.app.InteractiveCellUniverseTests$six_long_line_evolves_correctly_with_step$1.invokeSuspend(InteractiveCellUniverseTests.kt:481)
	at com.alexvanyo.composelife.ui.app.InteractiveCellUniverseTests$six_long_line_evolves_correctly_with_step$1.invoke(InteractiveCellUniverseTests.kt)
	at com.alexvanyo.composelife.ui.app.InteractiveCellUniverseTests$six_long_line_evolves_correctly_with_step$1.invoke(InteractiveCellUniverseTests.kt)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt$runUiTest$1$1.invokeSuspend(BaseUiInjectTest.android.kt:45)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt$runUiTest$1$1.invoke(BaseUiInjectTest.android.kt)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt$runUiTest$1$1.invoke(BaseUiInjectTest.android.kt)
	at com.alexvanyo.composelife.test.BaseInjectTest$runAppTest$1.invokeSuspend(BaseInjectTest.kt:58)
	at com.alexvanyo.composelife.test.BaseInjectTest$runAppTest$1.invoke(BaseInjectTest.kt)
	at com.alexvanyo.composelife.test.BaseInjectTest$runAppTest$1.invoke(BaseInjectTest.kt)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$1.invokeSuspend(TestBuilders.kt:318)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.test.TestDispatcher.processEvent$kotlinx_coroutines_test(TestDispatcher.kt:24)
	at kotlinx.coroutines.test.TestCoroutineScheduler.tryRunNextTaskUnless$kotlinx_coroutines_test(TestCoroutineScheduler.kt:99)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$workRunner$1.invokeSuspend(TestBuilders.kt:327)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at kotlinx.coroutines.test.TestBuildersJvmKt.createTestResult(TestBuildersJvm.kt:10)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:310)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(Unknown Source)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:168)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(Unknown Source)
	at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0$default(TestBuilders.kt:160)
	at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0$default(Unknown Source)
	at com.alexvanyo.composelife.test.BaseInjectTest.runAppTest(BaseInjectTest.kt:50)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt.runUiTest$lambda$0(BaseUiInjectTest.android.kt:44)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt.$r8$lambda$Xb2JZd7Lp-CV1D0kbm0Z781AQnQ(BaseUiInjectTest.android.kt)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt$$ExternalSyntheticLambda0.invoke(D8$$SyntheticClass:0)
	at androidx.compose.ui.test.ComposeUiTest_androidKt$runAndroidComposeUiTest$1.invoke(ComposeUiTest.android.kt:114)
	at androidx.compose.ui.test.ComposeUiTest_androidKt$runAndroidComposeUiTest$1.invoke(ComposeUiTest.android.kt:112)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidComposeUiTestImpl.withDisposableContent(ComposeUiTest.android.kt:585)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1$1$1$1.invoke(ComposeUiTest.android.kt:372)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.withComposeIdlingResource(ComposeUiTest.android.kt:441)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.access$withComposeIdlingResource(ComposeUiTest.android.kt:237)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1$1$1.invoke(ComposeUiTest.android.kt:371)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.withWindowRecomposer(ComposeUiTest.android.kt:415)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.access$withWindowRecomposer(ComposeUiTest.android.kt:237)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1$1.invoke(ComposeUiTest.android.kt:370)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.withTestCoroutines(ComposeUiTest.android.kt:428)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.access$withTestCoroutines(ComposeUiTest.android.kt:237)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1.invoke(ComposeUiTest.android.kt:369)
	at androidx.compose.ui.test.EspressoLink.withStrategy(EspressoLink.android.kt:69)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1.invoke(ComposeUiTest.android.kt:368)
	at androidx.compose.ui.test.IdlingResourceRegistry.withRegistry(IdlingResourceRegistry.jvm.kt:146)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1.invoke(ComposeUiTest.android.kt:367)
	at androidx.compose.ui.test.ComposeRootRegistry.withRegistry(ComposeRootRegistry.android.kt:137)
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.runTest(ComposeUiTest.android.kt:366)
	at androidx.compose.ui.test.ComposeUiTest_androidKt.runAndroidComposeUiTest(ComposeUiTest.android.kt:112)
	at com.alexvanyo.composelife.test.BaseUiInjectTest_androidKt.runUiTest(BaseUiInjectTest.android.kt:58)
	at com.alexvanyo.composelife.ui.app.InteractiveCellUniverseTests.six_long_line_evolves_correctly_with_step(InteractiveCellUniverseTests.kt:430)

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Base automatically changed from av/cell-state-drop-state to main December 28, 2024 07:10
@alexvanyo alexvanyo force-pushed the av/fix-initial-coil-rendering branch from a484c65 to 7802535 Compare December 28, 2024 16:58
@alexvanyo alexvanyo marked this pull request as ready for review December 28, 2024 16:58
@alexvanyo alexvanyo enabled auto-merge (rebase) December 28, 2024 16:58
@alexvanyo alexvanyo force-pushed the av/fix-initial-coil-rendering branch from 7802535 to d70ae71 Compare December 28, 2024 17:12
@alexvanyo alexvanyo disabled auto-merge December 28, 2024 17:23
@alexvanyo alexvanyo force-pushed the av/fix-initial-coil-rendering branch from d70ae71 to bb579d5 Compare December 28, 2024 17:37
@alexvanyo alexvanyo enabled auto-merge (rebase) December 28, 2024 17:38
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.

Cells rendering with Coil not rendering initially
1 participant