Remove duplicate unset.

This commit is contained in:
Reasno 2020-01-14 17:19:02 +08:00
parent 000c9462a9
commit 5bd376baf2
4 changed files with 12 additions and 12 deletions

View File

@ -331,8 +331,6 @@ class GrpcClient
}
// Force close.
if ($this->waitStatus === Status::WAIT_CLOSE_FORCE) {
$this->channelPool->release($this->recvChannelMap[$streamId]);
unset($this->recvChannelMap[$streamId]);
if ($this->closeRecv()) {
break;
}

View File

@ -50,6 +50,14 @@ class BaseClientTest extends TestCase
self::$server->start();
});
}
public static function tearDownAfterClass()
{
Coroutine::create(function () {
self::$server->shutdown();
});
}
public function setUp()
{
if (swoole_version() === '4.4.14') {
@ -65,13 +73,6 @@ class BaseClientTest extends TestCase
parent::tearDown();
}
public static function tearDownAfterClass()
{
Coroutine::create(function () {
self::$server->shutdown();
});
}
public function testGrpcClientConnectionFailure()
{
$this->getContainer();
@ -135,9 +136,9 @@ class BaseClientTest extends TestCase
{
$this->getContainer();
$client = new HiClient('127.0.0.1:2222', ['retry_attempts' => 0]);
try{
try {
$client->sayBug();
} catch(TypeError $e){
} catch (TypeError $e) {
$this->assertNotNull($e);
} finally {
$this->assertGreaterThan(0, $client->sayHello());

View File

@ -26,6 +26,7 @@ class HiClient extends BaseClient
[UserReply::class, 'decode']
);
}
public function sayBug()
{
return $this->simpleRequest(