Skip to content

Commit 0abf389

Browse files
authored
Merge pull request #250 from clue-labs/update-tests-v3
[3.x] Update test environment to avoid deprecated runner images and actions
2 parents 9b78ea6 + 3afb26a commit 0abf389

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- 7.2
2323
- 7.1
2424
steps:
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v7
2626
- uses: shivammathur/setup-php@v2
2727
with:
2828
php-version: ${{ matrix.php }}
@@ -36,10 +36,10 @@ jobs:
3636

3737
PHPUnit-macOS:
3838
name: PHPUnit (macOS)
39-
runs-on: macos-14
39+
runs-on: macos-26
4040
continue-on-error: true
4141
steps:
42-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v7
4343
- uses: shivammathur/setup-php@v2
4444
with:
4545
php-version: 8.5

‎tests/Query/TcpTransportExecutorTest.php‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneCh
324324
public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneChunkWhenServerClosesSocket()
325325
{
326326
if (PHP_OS === 'Darwin') {
327-
// 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)
327+
// 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)
328328
// Due to this race condition, this is somewhat flaky. Happens around 75% of the time, use `--repeat=100` to reproduce.
329329
// fwrite(): Send of 4260000 bytes failed with errno=41 Protocol wrong type for socket
330330
// @link http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
@@ -406,9 +406,10 @@ public function testQueryRejectsWhenClientKeepsSendingWhenServerClosesSocketWith
406406
$writePending = $ref->getValue($executor);
407407

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

0 commit comments

Comments
 (0)