[webkit-changes] [WebKit/WebKit] a08ec0: [ Sonoma Release ] 2 Storage API tests are flaky t...

Wenson Hsieh noreply at github.com
Thu Aug 1 07:23:02 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a08ec0dd1f5593f7845b88891bae4d23f1399b88
      https://github.com/WebKit/WebKit/commit/a08ec0dd1f5593f7845b88891bae4d23f1399b88
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-08-01 (Thu, 01 Aug 2024)

  Changed paths:
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBTempFileSize.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm

  Log Message:
  -----------
  [ Sonoma Release ] 2 Storage API tests are flaky timeouts.
https://bugs.webkit.org/show_bug.cgi?id=277455
rdar://132941950

Reviewed by Abrar Rahman Protyasha.

Adjust two API tests, IndexedDB.IndexedDBTempFileSize and WKWebView.LocalStorageProcessCrashes, so
that they're more robust. Currently, these tests both trigger actions that cause the web process to
post exactly two script messages and then use the following pattern to wait for both messages to be
received in `TestWebKitAPI`:

```
receivedScriptMessage = false;
TestWebKitAPI::Util::run(&receivedScriptMessage); // <--- (a)

receivedScriptMessage = false;
TestWebKitAPI::Util::run(&receivedScriptMessage); // <--- (b)
```

...however, it's possible for both messages to be posted right after each other in the UI process,
causing *both* messages to be received when the runloop turns in step (a), marked above. This
results in a timeout, as (b) will never return since the second message has already been received.

To avoid this flaky timeout, we can simply refactor these two tests so that we wait for the second
message to be received in the UI process, keep track of all messages received in an array, and then
check the contents of the array instead of the last received message.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBTempFileSize.mm:
(-[IndexedDBFileSizeMessageHandler userContentController:didReceiveScriptMessage:]):
(TEST(IndexedDB, IndexedDBTempFileSize)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm:
(-[LocalStorageMessageHandler userContentController:didReceiveScriptMessage:]):
(TEST(WKWebView, LocalStorageProcessCrashes)):

Canonical link: https://commits.webkit.org/281707@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list