From 9b265b2b593eca03b048dbaf169b23ac8a4e3274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Sun, 22 Sep 2019 15:36:15 +0800 Subject: [PATCH] Fixed bug. --- bin/co-phpunit | 5 ++--- src/utils/tests/Coroutine/ConcurrentTest.php | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/co-phpunit b/bin/co-phpunit index 140ee6e49..0a10b48e6 100755 --- a/bin/co-phpunit +++ b/bin/co-phpunit @@ -1,6 +1,6 @@ #!/usr/bin/env php ')) { fwrite( STDERR, @@ -51,9 +51,8 @@ require PHPUNIT_COMPOSER_INSTALL; $code = PHPUnit\TextUI\Command::main(false); + if ($code > 0) { exit($code); } - - swoole_event_exit(); }); diff --git a/src/utils/tests/Coroutine/ConcurrentTest.php b/src/utils/tests/Coroutine/ConcurrentTest.php index 67cacd108..6ba2760ec 100644 --- a/src/utils/tests/Coroutine/ConcurrentTest.php +++ b/src/utils/tests/Coroutine/ConcurrentTest.php @@ -65,6 +65,10 @@ class ConcurrentTest extends TestCase $this->assertSame(5, $count); $this->assertSame(10, $con->getRunningCoroutineCount()); + + while (! $con->isEmpty()) { + Coroutine::sleep(0.1); + } } protected function getContainer()