Created
August 10, 2019 18:44
-
-
Save motorro/de91fe2e930d2678c7c7bca62b2beb58 to your computer and use it in GitHub Desktop.
AppUpdateManager concurrent modification crash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
@LooperMode(LooperMode.Mode.PAUSED) | |
fun crashesWhenUnsubscribing() { | |
updateManager.setUpdateAvailable(100500) | |
updateManager.withInfo { | |
startUpdateFlowForResult(it, AppUpdateType.FLEXIBLE, activity, 100) | |
assertTrue(isConfirmationDialogVisible) | |
userAcceptsUpdate() | |
downloadStarts() | |
(1..2).map { | |
registerListener(object: InstallStateUpdatedListener { | |
override fun onStateUpdate(p0: InstallState?) { | |
unregisterListener(this) | |
} | |
}) | |
} | |
assertFailsWith<ConcurrentModificationException> { | |
downloadCompletes() | |
shadowOf(getMainLooper()).idle() | |
} | |
} | |
shadowOf(getMainLooper()).idle() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment