https://kotlinlang.org logo
#compose
Title
# compose
a

Andy Himberger

01/05/2022, 5:24 AM
Upgrading our compose version from 1.1.beta03 to current and one of our unit tests for a Popup started hanging. I can see in the history in beta04 a change was made adding a loop in popup I'm not sure how to workaround.
We hang in the unit test asserting there is a popup:
Copy code
composeTestRule.onNodeWithTag("ActionView").assert(hasAnyAncestor(isPopup()))
I can see in the callstack that AndroidPopup is hung here:
Copy code
LaunchedEffect(popupLayout) {
        while (isActive) {
            awaitFrame()
            popupLayout.pollForLocationOnScreenChange()
        }
    }
in new code that was added in this change: https://github.com/androidx/androidx/commit/d78c06d7d95724b6fe19f03128ae633c9796a9f6#diff-1528b749e18fe9e9996a5f677[…]fb524612e3270795610b144c55a8b2
I looked into this some more creating a simple test project, we use robolectric for our tests where this hangs, in a non-headless environment the hang doesn't happen