Repository navigation
Conversation
…lost WorkManager doesn't deliver every setProgress() update. When a draft is uploaded quickly, the thread screen sees the UPLOADING progress and then the finished WorkInfo without progress, so the "upload completed" updates that trigger the reload are lost and the thread keeps the old version of the edited draft. This made DraftsGmailAPITestCorrectCreatingAndUpdatingFlowTest fail on CI. Reload the thread when an upload run seen running finishes, and drop the STATE_COMMON_UPLOAD_COMPLETED progress that this replaces. In the test, wait for the messages instead of a UiAutomator wait that never fails.
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.
This PR fixes more flaky androidTests from #3211 (part 5, follows #3340, #3347, #3355 and #3358). One of them was caused by a bug in the app.
Draft upload: the thread didn't show the updated draft
DraftsGmailAPITestCorrectCreatingAndUpdatingFlowTestfailed 9 times on CI (7 branches, including master), mostly withPerformExceptionwhen scrolling to the edited draft. It was an app bug.UploadDraftsWorkerreported progress withsetProgress(), andThreadDetailsFragmentreloaded the thread on the final "upload completed" progress. WorkManager doesn't deliver every progress update. On a slow emulator the fragment gotRUNNING {STATE: UPLOADING}and thenSUCCEEDEDwith empty progress, so the thread kept the old version of the draft. A user would see the old version too.ThreadDetailsFragmentremembers theUploadDraftsWorkerruns it saw in theRUNNINGstate and silently reloads the thread when such a run finishes. TheSTATE_COMMON_UPLOAD_COMPLETEDprogress, which this replaces, is removed from the worker. The old code reloaded only for drafts of this thread. Now any draft upload reloads the open thread, which costs one extra silent request, and only while the thread screen is open.scrollTountil the message appears (up to 30 s). The oldwaitForObjectWithTextwaited silently and never failed, so the next step failed instead.Other tests
MessageDetailsFlowTest#testStandardMsgPlaintextWithOneAttachmentfailed on master withNoMatchingViewExceptionforlayoutAtt.BaseMessageDetailsFlowTestwaited a fixedThread.sleep(1000), but attachments are shown only after the message is parsed, which took 0.9–1.3 s on a slow emulator.baseCheckWithAtt()andmatchReplyButtons()now wait until the views are displayed.WkdClientTestwas the only class withoutRetryRule. Its CI failures came fromClearAppSettingsRulefailing to delete the Glide cache, and a retry handles that.docs/testing-like-ci.md: lost WorkManager progress updates.Testing (slow CI-like emulator,
docs/testing-like-ci.md)DraftsGmailAPITestCorrectCreatingAndUpdatingFlowTestwithout retries: failed 6 of 8 runs before the fix, passed 8 of 8 after it. The other 2DraftsGmailAPITestCorrect*FlowTestclasses pass too.MessageDetailsFlowTestand 6 other classes based onBaseMessageDetailsFlowTest: 58 tests passed, no retries.WkdClientTest: 5 tests passed.lintConsumerUiTestsand all unit tests (852) pass.CI for this branch fails in
ci-install-android-sdk.shbefore any tests run. It's fixed in #3375 (#3374). This PR's pipeline needs a rerun after that is merged.issue #3211
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):