Bug 225703

Summary: [TestWebKitAPI] Explicitly exit after completing tests
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, ap, darin, dewei_zhu, hi, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Jonathan Bedard 2021-05-12 10:56:44 PDT
Our API tests run in a non-standard way. We can't rely on the system to exit the process cleanly or immediately after returning from main because iOS does not ordinarily support command line programs.
Comment 1 Jonathan Bedard 2021-05-12 10:57:08 PDT
<rdar://problem/77673980>
Comment 2 Jonathan Bedard 2021-05-12 11:01:06 PDT
Created attachment 428385 [details]
Patch
Comment 3 Alexey Proskuryakov 2021-05-12 11:27:43 PDT
Comment on attachment 428385 [details]
Patch

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

> Tools/TestWebKitAPI/ios/mainIOS.mm:56
> -    return passed ? EXIT_SUCCESS : EXIT_FAILURE;
> +    exit(passed ? EXIT_SUCCESS : EXIT_FAILURE);

If this works, it works, but please add a comment linking to a radar that tracks investigating the root cause here.
Comment 4 Jonathan Bedard 2021-05-12 12:04:17 PDT
Created attachment 428397 [details]
Patch
Comment 5 EWS 2021-05-12 13:40:58 PDT
Committed r277387 (237643@main): <https://commits.webkit.org/237643@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428397 [details].
Comment 6 Darin Adler 2021-05-12 14:11:18 PDT
Comment on attachment 428397 [details]
Patch

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

> Tools/TestWebKitAPI/ios/mainIOS.mm:56
> +    // FIXME: Work-around for <rdar://problem/77922262>

I understand that Alexey requested a comment. And a comment is good. However, we do not need a FIXME. We can use exit() forever and need never go back to using return here. The comment can help us remember not to change the code back!