1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Port stream bug51056 and gh11418 tests to use ephemeral ports

This commit is contained in:
Jakub Zelenka
2024-12-31 15:18:50 +01:00
parent e0dabe326f
commit 19e2e4d5af
2 changed files with 6 additions and 10 deletions

View File

@@ -4,8 +4,8 @@ Bug #51056 (fread() on blocking stream will block even if data is available)
<?php
$serverCode = <<<'CODE'
$server = stream_socket_server('tcp://127.0.0.1:64327');
phpt_notify();
$server = stream_socket_server('tcp://127.0.0.1:0');
phpt_notify_server_start($server);
$conn = stream_socket_accept($server);
@@ -21,9 +21,7 @@ CODE;
$clientCode = <<<'CODE'
phpt_wait();
$fp = fsockopen("tcp://127.0.0.1:64327");
$fp = fsockopen("tcp://{{ ADDR }}");
while (!feof($fp)) {
$data = fread($fp, 256);

View File

@@ -4,8 +4,8 @@ GH-11418: fgets on a redis socket connection fails on PHP 8.3
<?php
$serverCode = <<<'CODE'
$server = stream_socket_server('tcp://127.0.0.1:64325');
phpt_notify();
$server = stream_socket_server('tcp://127.0.0.1:0');
phpt_notify_server_start($server);
$conn = stream_socket_accept($server);
@@ -19,9 +19,7 @@ CODE;
$clientCode = <<<'CODE'
phpt_wait();
$fp = fsockopen("tcp://127.0.0.1:64325");
$fp = fsockopen("tcp://{{ ADDR }}");
echo fread($fp, 3);
echo fgets($fp);