Bug 192810 - REGRESSION: [iOS] API test TestWebKitAPI._WKDownload.OriginatingWebView is a flaky failure
Summary: REGRESSION: [iOS] API test TestWebKitAPI._WKDownload.OriginatingWebView is a ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2018-12-18 09:31 PST by Ryan Haddad
Modified: 2018-12-18 15:59 PST (History)
7 users (show)

See Also:

Patch (3.10 KB, patch)
2018-12-18 14:45 PST, David Quesada
achristensen: review+
achristensen: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (3.07 KB, patch)
2018-12-18 15:21 PST, David Quesada
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Haddad 2018-12-18 09:31:27 PST
The following API test appears to be a flaky failure on iOS bots:

        Value of: !([download originatingWebView])
          Actual: false
        Expected: true

Comment 1 Radar WebKit Bug Importer 2018-12-18 09:38:40 PST
Comment 2 Ryan Haddad 2018-12-18 09:47:16 PST
It failed about 50% of the time for me locally when I ran:
run-api-tests --debug --ios-simulator _WKDownload.OriginatingWebView
Comment 3 David Quesada 2018-12-18 14:39:19 PST
When I see this fail, it doesn't appear that the originatingWebView has any remaining strong references, but is in the autorelease pool, likely as a result of handling other messages that have been sent to the UI process while the test has run. The test seems to pass (I've hit at least 20 successes in a row, compared to 3/10 successes without any changes) if I defer checking the originatingWebView to the next turn of the runloop. Patch coming up.
Comment 4 David Quesada 2018-12-18 14:45:41 PST
Created attachment 357614 [details]
Comment 5 Alex Christensen 2018-12-18 15:13:56 PST
Comment on attachment 357614 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=357614&action=review

> Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm:260
> +    WTF::callOnMainThread([retainedDownload = RetainPtr<_WKDownload> { download }] {

[download = retainPtr(download)]
Comment 6 David Quesada 2018-12-18 15:21:29 PST
Created attachment 357621 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2018-12-18 15:59:43 PST
Comment on attachment 357621 [details]
Patch for landing

Clearing flags on attachment: 357621

Committed r239359: <https://trac.webkit.org/changeset/239359>
Comment 8 WebKit Commit Bot 2018-12-18 15:59:44 PST
All reviewed patches have been landed.  Closing bug.