Fixed bug.

This commit is contained in:
李铭昕 2019-09-22 15:36:15 +08:00
parent 68d0b44248
commit 9b265b2b59
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
\Swoole\Coroutine::create(function () {
\Swoole\Coroutine\Run(function () {
if (version_compare('7.1.0', PHP_VERSION, '>')) {
fwrite(
STDERR,
@ -51,9 +51,8 @@
require PHPUNIT_COMPOSER_INSTALL;
$code = PHPUnit\TextUI\Command::main(false);
if ($code > 0) {
exit($code);
}
swoole_event_exit();
});

View File

@ -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()