From 2b82fd221b08df8c146766f132747c041d2669be Mon Sep 17 00:00:00 2001 From: Fabian Meyer Date: Tue, 4 Oct 2022 20:34:33 +0200 Subject: [PATCH 1/2] Use reactphp/async instead of clue/reactphp-block --- .github/workflows/ci.yml | 1 + composer.json | 2 +- tests/FunctionalTest.php | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0724232..28a6fd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ jobs: PHPUnit: name: PHPUnit (PHP ${{ matrix.php }}) runs-on: ubuntu-20.04 + timeout-minutes: 5 strategy: matrix: php: diff --git a/composer.json b/composer.json index 2a26a7a..3d5fcbf 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "react/socket": "^1.12" }, "require-dev": { - "clue/block-react": "^1.5", + "react/async": "^4 || ^3 || ^2", "clue/connection-manager-extra": "^1.3", "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", "react/event-loop": "^1.2", diff --git a/tests/FunctionalTest.php b/tests/FunctionalTest.php index dc8702f..b85deaf 100644 --- a/tests/FunctionalTest.php +++ b/tests/FunctionalTest.php @@ -2,10 +2,8 @@ namespace Clue\Tests\React\Socks; -use Clue\React\Block; use Clue\React\Socks\Client; use Clue\React\Socks\Server; -use React\EventLoop\Loop; use React\Socket\Connector; use React\Socket\SecureConnector; use React\Socket\SocketServer; @@ -495,7 +493,7 @@ private function assertResolveStream($promise) $stream->close(); }); - Block\await($promise, Loop::get(), 2.0); + \React\Async\await(\React\Promise\Timer\timeout($promise, 2.0)); } private function assertRejectPromise($promise, $message = null, $code = null) @@ -514,6 +512,6 @@ private function assertRejectPromise($promise, $message = null, $code = null) $this->setExpectedException('Exception', $message, $code); } - Block\await($promise, Loop::get(), 2.0); + \React\Async\await(\React\Promise\Timer\timeout($promise, 2.0)); } } From 27a161555546f3740786289e34ee79435ae7fa17 Mon Sep 17 00:00:00 2001 From: Fabian Meyer Date: Sat, 19 Nov 2022 21:36:27 +0100 Subject: [PATCH 2/2] Update tests to close any server sockets --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28a6fd3..6f16c82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: PHPUnit: name: PHPUnit (PHP ${{ matrix.php }}) runs-on: ubuntu-20.04 - timeout-minutes: 5 + timeout-minutes: 6 strategy: matrix: php: