Bug 206012 - REGRESSION: ( r254222 ) [ Mac Debug ] TestWebKitAPI.AsyncFunction.Promise is timing out
Summary: REGRESSION: ( r254222 ) [ Mac Debug ] TestWebKitAPI.AsyncFunction.Promise is ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-09 09:00 PST by Truitt Savell
Modified: 2020-01-17 12:06 PST (History)
7 users (show)

See Also:


Attachments
Patch (5.25 KB, patch)
2020-01-17 10:34 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (5.32 KB, patch)
2020-01-17 10:46 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (5.42 KB, patch)
2020-01-17 11:22 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Truitt Savell 2020-01-09 09:00:54 PST
TestWebKitAPI.AsyncFunction.Promise

Description:
This API test was introduced as timing out from https://trac.webkit.org/changeset/254222/webkit

History:
https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.AsyncFunction.Promise
Comment 1 Radar WebKit Bug Importer 2020-01-09 09:01:26 PST
<rdar://problem/58445164>
Comment 2 Jonathan Bedard 2020-01-17 09:30:02 PST
This is specific to debug builds.
Comment 3 Brady Eidson 2020-01-17 10:34:19 PST
Created attachment 388055 [details]
Patch
Comment 4 Brady Eidson 2020-01-17 10:38:51 PST
Want a review on this from a JSC guy - This forced GC pass with only 1 function call appears to work! Should I actually expect that it works?
Comment 5 Brady Eidson 2020-01-17 10:46:23 PST
Created attachment 388059 [details]
Patch
Comment 6 Keith Miller 2020-01-17 11:07:34 PST
Comment on attachment 388059 [details]
Patch

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

r- because I think this is backwards. But maybe I'm misunderstanding the logic.

> Tools/ChangeLog:9
> +        But it turns out ne copy of the function call and an API call to force a GC pass seems to be enough.

Nit: Typo, I'm not sure what the exact sentence you were trying to say was though... :P

> Tools/TestWebKitAPI/Tests/WebKitCocoa/AsyncFunction.mm:275
> +        [webView _callAsyncJavaScriptFunction:functionBody withArguments:nil inWorld:_WKContentWorld.pageContentWorld completionHandler:[&] (id result, NSError *error) {
> +            EXPECT_NULL(result);
> +            EXPECT_TRUE(error != nil);
> +            EXPECT_TRUE([[error description] containsString:@"no longer reachable"]);
> +            done = true;

I think this is the opposite of what you want? I think you want to confirm that it returned an error at least once not 100% of the time.
Comment 7 Brady Eidson 2020-01-17 11:10:01 PST
(In reply to Keith Miller from comment #6)
> Comment on attachment 388059 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=388059&action=review
> 
> r- because I think this is backwards. But maybe I'm misunderstanding the
> logic.
> 
> > Tools/ChangeLog:9
> > +        But it turns out ne copy of the function call and an API call to force a GC pass seems to be enough.
> 
> Nit: Typo, I'm not sure what the exact sentence you were trying to say was
> though... :P
> 
> > Tools/TestWebKitAPI/Tests/WebKitCocoa/AsyncFunction.mm:275
> > +        [webView _callAsyncJavaScriptFunction:functionBody withArguments:nil inWorld:_WKContentWorld.pageContentWorld completionHandler:[&] (id result, NSError *error) {
> > +            EXPECT_NULL(result);
> > +            EXPECT_TRUE(error != nil);
> > +            EXPECT_TRUE([[error description] containsString:@"no longer reachable"]);
> > +            done = true;
> 
> I think this is the opposite of what you want? I think you want to confirm
> that it returned an error at least once not 100% of the time.

Actually all this does is checks that *at least one* returns an error.
The promise *never* gets resolved, so the callback will never take place... UNLESS it takes place because of GC.
Comment 8 Keith Miller 2020-01-17 11:14:27 PST
> > I think this is the opposite of what you want? I think you want to confirm
> > that it returned an error at least once not 100% of the time.
> 
> Actually all this does is checks that *at least one* returns an error.
> The promise *never* gets resolved, so the callback will never take place...
> UNLESS it takes place because of GC.

Ah, misread the code. r=me with the nit in the ChangeLog then.
Comment 9 Brady Eidson 2020-01-17 11:22:16 PST
Created attachment 388069 [details]
Patch
Comment 10 WebKit Commit Bot 2020-01-17 12:06:10 PST
Comment on attachment 388069 [details]
Patch

Clearing flags on attachment: 388069

Committed r254756: <https://trac.webkit.org/changeset/254756>
Comment 11 WebKit Commit Bot 2020-01-17 12:06:11 PST
All reviewed patches have been landed.  Closing bug.