New issue
Advanced search Search tips

Issue 873204 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Bug



Sign in to add a comment

ios_chrome_ui_egtests download manager tests flaking

Project Member Reported by ellyjo...@chromium.org, Aug 10

Issue description

To pinkerton@ for iOS triage:

[0809/214454.380242:WARNING:embedded_test_server.cc(238)] Request not handled. Returning 404: /favicon.ico
../../ios/chrome/browser/ui/download/download_manager_egtest.mm:147: error: -[DownloadManagerTestCase testDownloadWhileBrowsing] : Exception: NoMatchingElementException
Exception Name: NoMatchingElementException
Exception Reason: Cannot find UI element.
Exception with Action: {
  "Action Name":  "Tap",
  "Element Matcher":  "(((respondsToSelector(isAccessibilityElement) && isAccessibilityElement) && accessibilityLabel('Download')) && ((respondsToSelector(isAccessibilityElement) && isAccessibilityElement) && accessibilityTraits: UIAccessibilityTraitButton))",
  "Recovery Suggestion":  "Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element."
}
Exception Details: Error Trace: [
  {
    "Description":  "Interaction cannot continue because the desired element was not found.",
    "Error Domain":  "com.google.earlgrey.ElementInteractionErrorDomain",
    "Error Code":  "0",
    "File Name":  "GREYElementInteraction.m",
    "Function Name":  "-[GREYElementInteraction matchedElementsWithTimeout:error:]",
    "Line":  "124",
    "TestCase Class":  "DownloadManagerTestCase",
    "TestCase Method":  "testDownloadWhileBrowsing"
  }
]

https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/ios-uirefresh-simulator/1490
 
Owner: eugene...@chromium.org

Comment 2 Deleted

Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 29

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eabc228b25f1ca123bbb13b6c5bb9a6c68b8a9f6

commit eabc228b25f1ca123bbb13b6c5bb9a6c68b8a9f6
Author: Eugene But <eugenebut@google.com>
Date: Thu Nov 29 17:23:50 2018

Fix DownloadManagerTestCase flakiness.

On iOS 12 URLSession:dataTask:didReceiveData: delegate method can be
called when task is in NSURLSessionTaskStateCompleted state. This
resulted in extra URLFetcherResponseWriter::Finish call (one from
didReceiveData: and one from didCompleteWithError:).
URLFetcherResponseWriter::Finish DCHECKs if Finish is called twice, so
the test was flaky.

This CL changes DownloadTaskImpl to only call
URLFetcherResponseWriter::Finish from didCompleteWithError:.

Bug:  873204 
Change-Id: Ie6b8757e2c5c5d35da088fd108d92ee3ed13244d
Reviewed-on: https://chromium-review.googlesource.com/c/1354233
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612249}
[modify] https://crrev.com/eabc228b25f1ca123bbb13b6c5bb9a6c68b8a9f6/ios/web/download/download_task_impl.mm

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 29

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f674bb5dec9f976de034e10b5cb899c7ebe0a223

commit f674bb5dec9f976de034e10b5cb899c7ebe0a223
Author: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Date: Thu Nov 29 17:52:04 2018

Revert "Fix DownloadManagerTestCase flakiness."

This reverts commit eabc228b25f1ca123bbb13b6c5bb9a6c68b8a9f6.

Reason for revert: May have caused a compile error that closed the tree: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/ios-webview/2197

Original change's description:
> Fix DownloadManagerTestCase flakiness.
> 
> On iOS 12 URLSession:dataTask:didReceiveData: delegate method can be
> called when task is in NSURLSessionTaskStateCompleted state. This
> resulted in extra URLFetcherResponseWriter::Finish call (one from
> didReceiveData: and one from didCompleteWithError:).
> URLFetcherResponseWriter::Finish DCHECKs if Finish is called twice, so
> the test was flaky.
> 
> This CL changes DownloadTaskImpl to only call
> URLFetcherResponseWriter::Finish from didCompleteWithError:.
> 
> Bug:  873204 
> Change-Id: Ie6b8757e2c5c5d35da088fd108d92ee3ed13244d
> Reviewed-on: https://chromium-review.googlesource.com/c/1354233
> Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
> Commit-Queue: Eugene But <eugenebut@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#612249}

TBR=sdefresne@chromium.org,eugenebut@chromium.org

Change-Id: I1f7e7620911c73ce1f497fb6ae7b09ed16a2547f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  873204 
Reviewed-on: https://chromium-review.googlesource.com/c/1355600
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612251}
[modify] https://crrev.com/f674bb5dec9f976de034e10b5cb899c7ebe0a223/ios/web/download/download_task_impl.mm

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/58e2f02727f681c82fd2529e42277c931e453072

commit 58e2f02727f681c82fd2529e42277c931e453072
Author: Eugene But <eugenebut@google.com>
Date: Mon Dec 03 18:28:19 2018

Reland Fix DownloadManagerTestCase flakiness.

On iOS 12 URLSession:dataTask:didReceiveData: delegate method can be
called when task is in NSURLSessionTaskStateCompleted state. This
resulted in extra URLFetcherResponseWriter::Finish call (one from
didReceiveData: and one from didCompleteWithError:).
URLFetcherResponseWriter::Finish DCHECKs if Finish is called twice, so
the test was flaky.

This CL changes DownloadTaskImpl to only call
URLFetcherResponseWriter::Finish from didCompleteWithError:.

Originally Reviewed-on: https://chromium-review.googlesource.com/c/1354233

Bug:  873204 
Change-Id: Idece867d9d27c46a0deb57096144ed62df056901
Reviewed-on: https://chromium-review.googlesource.com/c/1355535
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613165}
[modify] https://crrev.com/58e2f02727f681c82fd2529e42277c931e453072/ios/web/download/download_task_impl.mm

Status: Fixed (was: Started)

Sign in to add a comment