[webkit-changes] [WebKit/WebKit] c42fc3: [ New Test ] (254473 at main): [ macOS Debug ] TestI...

Kimmo Kinnunen noreply at github.com
Sun Oct 16 11:38:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c42fc3b27592d4628b5075368b4a088619d9f804
      https://github.com/WebKit/WebKit/commit/c42fc3b27592d4628b5075368b4a088619d9f804
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2022-10-16 (Sun, 16 Oct 2022)

  Changed paths:
    M Source/WebKit/Platform/IPC/Connection.cpp
    M Source/WebKit/Platform/IPC/Connection.h
    M Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm
    M Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp

  Log Message:
  -----------
  [ New Test ] (254473 at main): [ macOS Debug ]  TestIPC.ConnectionTest/OpenedConnectionTest.AInvalidateDeliversBDidClose/ClientIsA is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=245787
rdar://problem/100511956

Reviewed by Chris Dumez.

On Cocoa:
Before, IPC::Connection would detect the other side disconnecting
like so:
- Before the other side opens the connection, observe
  NO_SENDERS message through the listening port.
- After the other side opens the connection, stop
  observing NO_SENDERS and start observing SEND_DEAD
  of the send port.

This would fail in corner cases like the test in the subject,
where the client would close the connection during initialization
phase. The server Connection would receive
InitializeConnection message, containing the send port.
The server would stop observing NO_SENDERS, but would not
verify whether the send port was already a DEAD_NAME
port.

Simplify by just observing the NO_SENDERS in both cases:
before and after connection open. If the send port is
already DEAD_NAME when server receives it, process the
messages and then process the NO_SENDERS.

This has the added benefit that NO_SENDERS is dispatched
after dispatching all the messages. This is useful
in scenarios where the sender sends messages and then
immediately closes -- the messages should be still
delivered as usual. This consistency behavior is not yet
implemented due to the dispatching logic of the Connection.

* Source/WebKit/Platform/IPC/Connection.cpp:
(IPC::Connection::dispatchOnReceiveQueueForTesting):
* Source/WebKit/Platform/IPC/Connection.h:
* Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm:
(IPC::requestNoSenderNotifications):
(IPC::clearNoSenderNotifications):
(IPC::Connection::platformInvalidate):
(IPC::Connection::cancelSendSource):
(IPC::Connection::platformOpen):
(IPC::Connection::sendMessage):
(IPC::Connection::platformCanSendOutgoingMessages const):
(IPC::Connection::sendOutgoingMessage):
(IPC::Connection::initializeSendSource):
(IPC::Connection::resumeSendSource):
(IPC::readFromMachPort):
(IPC::Connection::receiveSourceEventHandler):
(IPC::Connection::getAuditToken):
* Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp:
(TestWebKitAPI::TEST_F):
(TestWebKitAPI::ensureConnectionWorkQueueEmpty):
(TestWebKitAPI::ConnectionTestBase::setupBase):
(TestWebKitAPI::ConnectionTestBase::teardownBase):
(TestWebKitAPI::ConnectionTest::openServer):
(TestWebKitAPI::ConnectionTest::openClient):
(TestWebKitAPI::ConnectionTest::server):
(TestWebKitAPI::ConnectionTest::client):
(TestWebKitAPI::ConnectionTest::serverClient):
(TestWebKitAPI::ConnectionTest::clientClient):
(TestWebKitAPI::ConnectionTest::deleteServer):
(TestWebKitAPI::ConnectionTest::deleteClient):
(TestWebKitAPI::PrintTo):
(TestWebKitAPI::ConnectionTestABBA::serverIsA const):
(TestWebKitAPI::TEST_P):
(TestWebKitAPI::OpenedConnectionTest::serverIsA const): Deleted.
(TestWebKitAPI::OpenedConnectionTest::SetUp): Deleted.
(TestWebKitAPI::OpenedConnectionTest::TearDown): Deleted.
(TestWebKitAPI::OpenedConnectionTest::openA): Deleted.
(TestWebKitAPI::OpenedConnectionTest::openB): Deleted.
(TestWebKitAPI::OpenedConnectionTest::openBoth): Deleted.
(TestWebKitAPI::OpenedConnectionTest::a): Deleted.
(TestWebKitAPI::OpenedConnectionTest::aClient): Deleted.
(TestWebKitAPI::OpenedConnectionTest::b): Deleted.
(TestWebKitAPI::OpenedConnectionTest::bClient): Deleted.
(TestWebKitAPI::OpenedConnectionTest::deleteA): Deleted.
(TestWebKitAPI::OpenedConnectionTest::deleteB): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:

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




More information about the webkit-changes mailing list