Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- 7.2
- 7.1
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand All @@ -36,10 +36,10 @@ jobs:

PHPUnit-macOS:
name: PHPUnit (macOS)
runs-on: macos-14
runs-on: macos-26
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: shivammathur/setup-php@v2
with:
php-version: 8.5
Expand Down
9 changes: 5 additions & 4 deletions tests/Query/TcpTransportExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneCh
public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneChunkWhenServerClosesSocket()
{
if (PHP_OS === 'Darwin') {
// Skip on macOS because it exhibits what looks like a kernal race condition when sending excessive data to a socket that is about to shut down (EPROTOTYPE)
// Skip on macOS because it exhibits what looks like a kernel race condition when sending excessive data to a socket that is about to shut down (ECONNRESET, or EPROTOTYPE before macOS 12)
// Due to this race condition, this is somewhat flaky. Happens around 75% of the time, use `--repeat=100` to reproduce.
// fwrite(): Send of 4260000 bytes failed with errno=41 Protocol wrong type for socket
// @link http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
Expand Down Expand Up @@ -406,9 +406,10 @@ public function testQueryRejectsWhenClientKeepsSendingWhenServerClosesSocketWith
$writePending = $ref->getValue($executor);

// We expect an EPIPE (Broken pipe) on second write.
// However, macOS may report EPROTOTYPE (Protocol wrong type for socket) on first write due to kernel race condition.
// fwrite(): Send of 4260000 bytes failed with errno=41 Protocol wrong type for socket
// However, macOS may report ECONNRESET (Connection reset by peer) on first write due to kernel race condition.
// Before macOS 12, this was reported as EPROTOTYPE (Protocol wrong type for socket) instead.
// @link http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
// @link https://github.com/apple-oss-distributions/xnu/blob/xnu-8019.41.5/bsd/netinet/tcp_usrreq.c#L1093
if ($writePending) {
$executor->handleWritable();
}
Expand All @@ -420,7 +421,7 @@ public function testQueryRejectsWhenClientKeepsSendingWhenServerClosesSocketWith
$this->expectException(
\RuntimeException::class,
'Unable to send query to DNS server tcp://' . $address . ' (',
defined('SOCKET_EPIPE') ? (PHP_OS !== 'Darwin' || $writePending ? SOCKET_EPIPE : SOCKET_EPROTOTYPE) : null
defined('SOCKET_EPIPE') ? (PHP_OS !== 'Darwin' || $writePending ? SOCKET_EPIPE : SOCKET_ECONNRESET) : null
);
throw $exception;
}
Expand Down
Loading