DanielMartinus / Konfetti

Celebrate more with this lightweight confetti particle system 🎊
ISC License
3.11k stars 299 forks source link

Error for a composable with a KonfettiView on instrumented android test #306

Open anthony-fresneau-kiplin opened 1 year ago

anthony-fresneau-kiplin commented 1 year ago

An error occurred in an instrumented Android test on a composable with a KonfettiVIew inside

androidx.compose.ui.test.junit4.android.ComposeNotIdleException: Idling resource timed out: possibly due to compose being busy.
IdlingResourceRegistry has the following idling resources registered:
- [busy] ComposeIdlingResource is busy due to pending recompositions.
- Note: Timeout on pending recomposition means that there are most likely infinite re-compositions happening in the tested code.

Any idea to avoid this error ?

anthony-fresneau-kiplin commented 1 year ago

Any updates about this bug ?

DanielMartinus commented 1 year ago

Hi Anthony, I'm not directly familiar with the issue. If the issue is easily reproducible could you maybe link a sample project where the issue is reproduced so I can easily help investigate this issue.

Thanks!

crowleysimon commented 1 month ago

Hi @DanielMartinus, I'm experiencing the same issue and unable to run instrumentation tests on any composable using konfetti-compose. I've created a simple project for recreating the issue:

https://github.com/crowleysimon/KonfettiTest

It contains two composables, one using KonfettiView from konfetti-compose and the other from konfetti-xml. With an instrumentation test that just displays each one and checks to see if it is there.

From my experience, using an xml KonfettiView in a compose AndroidView works fine, whereas a compose KonfettiView will always fail due to idling, even if you pass in an empty list of parties or use an emitter that only runs for a very short amount of time.