Bug 240243

Summary: TestAPI::promiseUnhandledRejection() predominantly fails on MacOS 12.3 in --debug
Product: WebKit Reporter: Truitt Savell <tsavell>
Component: Tools / TestsAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, ashvayka, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bot-watchers-bugzilla, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   
See Also: https://bugs.webkit.org/show_bug.cgi?id=161942
Attachments:
Description Flags
Patch
none
Patch for landing ashvayka: commit-queue-

Description Truitt Savell 2022-05-09 11:25:39 PDT
testapi

This test is flaky failing for a long time in history. I do not have a regression point. 

History:
https://results.webkit.org/?suite=javascriptcore-tests&test=testapi

build:
https://build.webkit.org/#/builders/378/builds/1036
Comment 1 Radar WebKit Bug Importer 2022-05-09 11:26:03 PDT
<rdar://problem/92975620>
Comment 2 Alexey Proskuryakov 2022-05-09 13:45:01 PDT
I'm not entirely sure how to interpret testapi output, but looks like there is more that one failure:

callback should receive rejected promise as first argument: FAILED
callback should receive rejection reason as second argument: FAILED
callback should not receive a third argument: PASSED

C-API tests in C++ had 2 failures

ASSERTION FAILED: !testCAPIViaCpp(filter)
/Volumes/Data/worker/Apple-Monterey-Debug-Build/build/Source/JavaScriptCore/API/tests/testapi.c(1409) : int main(int, char **)
1   0x112cb4ab0 WTFCrash
2   0x100823f80 main
3   0x100ced088
Comment 3 Mark Lam 2022-05-09 14:34:48 PDT
I've also seen this fail intermittently on a Release build on M1 (when testapi is run while some heavy load is running in the background like a WebKit build).  I've never seen it on a Debug build yet.
Comment 4 Ryan Haddad 2022-05-23 09:18:07 PDT
*** Bug 240804 has been marked as a duplicate of this bug. ***
Comment 5 Alexey Shvayka 2022-05-23 15:16:53 PDT
Created attachment 459688 [details]
Patch
Comment 6 Mark Lam 2022-05-23 16:09:05 PDT
Comment on attachment 459688 [details]
Patch

LGTM
Comment 7 Alexey Shvayka 2022-05-24 11:15:36 PDT
Created attachment 459728 [details]
Patch for landing
Comment 8 Mark Lam 2022-05-24 16:51:45 PDT
https://github.com/WebKit/WebKit/pull/989
Comment 9 EWS 2022-05-25 11:14:00 PDT
Committed r294811 (250965@main): <https://commits.webkit.org/250965@main>

Reviewed commits have been landed. Closing PR #989 and removing active labels.