Repository navigation
test(e2e): stabilise all_files_permission by revoking only while the demo app is stopped - #3761
Open
Fishbowler wants to merge 1 commit into
Open
Fishbowler wants to merge 1 commit into
Fishbowler wants to merge 1 commit into
Conversation
all_files_permission's setPermissions-deny section revoked all-files access straight after launchApp, while the app was still starting. Android ends an app's process when that access is revoked and does not restart it, so when the revoke landed after startup the flow found the home screen instead of the app. It failed this way in 2 of 19 full-suite runs across API 33-37, once each on 36 and 37. Stop the app before revoking, and reopen it with its own example:// link rather than launchApp, which applies permissions of its own and so could mask a broken revoke. Run alone, the flow passes 15/15 on API 34 and 10/10 on API 37, and changing the revoke to allow makes it fail at "All Files: Not allowed".
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
all_files_permissione2e flow fails intermittently on Android: aftersetPermissionsrevokes all-files access, it lands on the home screen instead of the demo app and can't find "Permission Check". It failed this way in 2 of 19 full-suite runs across API 33–37 (once each on 36 and 37), which stands in the way of moving CI to a newer Android version.Approach
Android ends an app's process when all-files access is revoked, and does not restart it. The flow revoked access straight after
launchApp, which returns before the app has finished starting. Whether the app survived depended on when the revoke landed. Revoking by hand at set delays afteram starton API 34:The section now stops the app, revokes, and reopens it with its own
example://link. It doesn't reopen withlaunchAppbecause that applies permissions of its own (all: allowby default) and could mask a broken revoke. Between the revoke and the assertion, onlysetPermissionsand Android touch the permission. Granting doesn't kill the app, so the other sections are unchanged.Verification
On arm64 emulators configured like CI's (4 cores, 4192 MB, swiftshader, 606×1280),
all_files_permission.yamlrun alone passed 15/15 on API 34 and 10/10 on API 37, and logcat shows the section no longer kills the app. The old flow also passed 15/15 run alone, because the race is rare, so the table above is the evidence for the cause. Changing the section's revoke toallowmakes the flow fail atAll Files: Not allowed, so the section still checks the deny.