[webkit-changes] [WebKit/WebKit] e6b676: New test: [iOS macOS] TestIPC.StreamConnectionTest...

Kimmo Kinnunen noreply at github.com
Sat Jan 14 07:45:35 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e6b67655bc4fb2dcbc0e09b6024792603c6e0261
      https://github.com/WebKit/WebKit/commit/e6b67655bc4fb2dcbc0e09b6024792603c6e0261
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-01-14 (Sat, 14 Jan 2023)

  Changed paths:
    M Source/WebKit/Platform/IPC/StreamConnectionWorkQueue.cpp
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/IPC/IPCTestUtilities.h
    M Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp
    A Tools/TestWebKitAPI/Tests/IPC/StreamConnectionWorkQueueTests.cpp

  Log Message:
  -----------
  New test: [iOS macOS] TestIPC.StreamConnectionTest.SendAsyncReplyMessage is timing out
https://bugs.webkit.org/show_bug.cgi?id=249780
rdar://103640558

Reviewed by Matt Woodrow.

The test would time out mainly because the communication semaphores were not
set up between client and server connection.
If the server would be slow enough, the initial processing wakeup due to
starting message listening would make the test pass.
If the server would be fast enough, the initial processing wakeup would
not process all messages that the test would send, and thus it would
time out. Fix by setting the semaphores, so new messages will wake up
the server work queue.

Secondarily make the test more consistent by running all the server
related code in the server work queue.

The first point needs IPCSemaphore to have copy operations, so implement
these. Add tests for IPCSemaphore, test also the new operations.
These semaphores are typically sent as part of the initialization message
exchange between client and server (CreateXXX, DidCreateXXX messages).
The unit tests run in single process, there is no message exchange
to setup the connection.

The second point needs a fix for StreamConnectionWorkQueue, where
the tasks that would be run during shutdown would crash if the
tasks would assert that the task is run on correct queue. Fix by
not removing the m_processingThread reference until the thread
has exited. Add a test for this.

* Source/WebKit/Platform/IPC/StreamConnectionWorkQueue.cpp:
(IPC::StreamConnectionWorkQueue::stopAndWaitForCompletion):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/IPC/IPCTestUtilities.h:
(TestWebKitAPI::copyViaEncoder):
* Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp:
(TestWebKitAPI::StreamConnectionTest::localReferenceBarrier):
(TestWebKitAPI::StreamConnectionTest::serverQueue):
(TestWebKitAPI::TEST_F):
(TestWebKitAPI::StreamConnectionTest::StreamConnectionTest): Deleted.
* Tools/TestWebKitAPI/Tests/IPC/StreamConnectionWorkQueueTests.cpp: Added.
(TestWebKitAPI::TEST_F):

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




More information about the webkit-changes mailing list