PHP: fix persistentChannelTest error

pull/15061/head
ZhouyihaiDing 7 years ago
parent be03078e10
commit 4a134047a4
  1. 8
      src/php/tests/unit_tests/PersistentChannelTest.php

@ -42,6 +42,11 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
$this->assertTrue(false); $this->assertTrue(false);
} }
public function assertConnecting($state) {
$this->assertTrue($state == GRPC\CHANNEL_CONNECTING ||
$state == GRPC\CHANNEL_TRANSIENT_FAILURE);
}
public function testPersistentChennelCreateOneChannel() public function testPersistentChennelCreateOneChannel()
{ {
$this->channel1 = new Grpc\Channel('localhost:1', []); $this->channel1 = new Grpc\Channel('localhost:1', []);
@ -66,8 +71,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
$this->waitUntilNotIdle($this->channel1); $this->waitUntilNotIdle($this->channel1);
$plist = $this->channel1->getPersistentList(); $plist = $this->channel1->getPersistentList();
$this->assertEquals($plist['localhost:1']['connectivity_status'], $this->assertConnecting($plist['localhost:1']['connectivity_status']);
GRPC\CHANNEL_CONNECTING);
$this->assertEquals($plist['localhost:1']['is_valid'], 1); $this->assertEquals($plist['localhost:1']['is_valid'], 1);
$this->channel1->close(); $this->channel1->close();

Loading…
Cancel
Save