aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Zhouyihai Ding <ddyihai@google.com>2018-04-13 15:42:10 -0700
committerGravatar GitHub <noreply@github.com>2018-04-13 15:42:10 -0700
commit7929e41f21ea639f95b9e3b9e694e57a23b860d6 (patch)
treea0824d18019e9a278988b67aac2fa8542bfb1559
parent48b3d9366194d6296ce37991917f2ca598eb0043 (diff)
parent4a134047a4671b8ec263d9b99f2765e78641a6c4 (diff)
Merge pull request #15061 from ZhouyihaiDing/Plist_test
PHP: fix persistentChannelTest error
-rw-r--r--src/php/tests/unit_tests/PersistentChannelTest.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/php/tests/unit_tests/PersistentChannelTest.php b/src/php/tests/unit_tests/PersistentChannelTest.php
index 31c6bbaf40..171780a137 100644
--- a/src/php/tests/unit_tests/PersistentChannelTest.php
+++ b/src/php/tests/unit_tests/PersistentChannelTest.php
@@ -42,6 +42,11 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
$this->assertTrue(false);
}
+ public function assertConnecting($state) {
+ $this->assertTrue($state == GRPC\CHANNEL_CONNECTING ||
+ $state == GRPC\CHANNEL_TRANSIENT_FAILURE);
+ }
+
public function testPersistentChennelCreateOneChannel()
{
$this->channel1 = new Grpc\Channel('localhost:1', []);
@@ -66,8 +71,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
$this->waitUntilNotIdle($this->channel1);
$plist = $this->channel1->getPersistentList();
- $this->assertEquals($plist['localhost:1']['connectivity_status'],
- GRPC\CHANNEL_CONNECTING);
+ $this->assertConnecting($plist['localhost:1']['connectivity_status']);
$this->assertEquals($plist['localhost:1']['is_valid'], 1);
$this->channel1->close();