Merge pull request #16404 from ZhouyihaiDing/fix_16392

PHP: fix failed test 16392
pull/16408/head
Zhouyihai Ding 6 years ago committed by GitHub
commit 5fb2281ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php

@ -270,7 +270,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
public function testPersistentChannelDefaultOutBound1()
{
$this->channel1 = new Grpc\Channel('localhost:10011', []);
$this->channel1 = new Grpc\Channel('localhost:10004', []);
// Make channel1 not IDLE.
$this->channel1->getConnectivityState(true);
$this->waitUntilNotIdle($this->channel1);
@ -280,7 +280,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
// Since channel1 is CONNECTING, channel 2 will not be persisted
$channel_credentials = Grpc\ChannelCredentials::createSsl(null, null,
null);
$this->channel2 = new Grpc\Channel('localhost:10011',
$this->channel2 = new Grpc\Channel('localhost:10004',
['credentials' => $channel_credentials]);
$channel2_info = $this->channel2->getChannelInfo();
$this->assertEquals(GRPC\CHANNEL_IDLE, $channel2_info['connectivity_status']);
@ -295,7 +295,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
public function testPersistentChannelDefaultOutBound2()
{
$this->channel1 = new Grpc\Channel('localhost:10011', []);
$this->channel1 = new Grpc\Channel('localhost:10005', []);
$channel1_info = $this->channel1->getChannelInfo();
$this->assertEquals(GRPC\CHANNEL_IDLE, $channel1_info['connectivity_status']);
@ -303,7 +303,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
// gRPC channel. channel2 will not be persisted
$channel_credentials = Grpc\ChannelCredentials::createSsl(null, null,
null);
$this->channel2 = new Grpc\Channel('localhost:10011',
$this->channel2 = new Grpc\Channel('localhost:10005',
['credentials' => $channel_credentials]);
$channel2_info = $this->channel2->getChannelInfo();
$this->assertEquals(GRPC\CHANNEL_IDLE, $channel2_info['connectivity_status']);
@ -318,7 +318,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
public function testPersistentChannelDefaultOutBound3()
{
$this->channel1 = new Grpc\Channel('localhost:10011', []);
$this->channel1 = new Grpc\Channel('localhost:10006', []);
$channel1_info = $this->channel1->getChannelInfo();
$this->assertEquals(GRPC\CHANNEL_IDLE, $channel1_info['connectivity_status']);
@ -327,7 +327,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
// channel2 can be persisted.
$channel_credentials = Grpc\ChannelCredentials::createSsl(null, null,
null);
$this->channel2 = new Grpc\Channel('localhost:10011',
$this->channel2 = new Grpc\Channel('localhost:10006',
['credentials' => $channel_credentials]);
$channel2_info = $this->channel2->getChannelInfo();
$this->assertEquals(GRPC\CHANNEL_IDLE, $channel2_info['connectivity_status']);
@ -342,7 +342,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
public function testPersistentChannelTwoUpperBound()
{
$this->channel1 = new Grpc\Channel('localhost:10011', [
$this->channel1 = new Grpc\Channel('localhost:10007', [
"grpc_target_persist_bound" => 2,
]);
$channel1_info = $this->channel1->getChannelInfo();
@ -351,7 +351,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase
// Since channel1 is IDLE, channel 1 will be deleted
$channel_credentials = Grpc\ChannelCredentials::createSsl(null, null,
null);
$this->channel2 = new Grpc\Channel('localhost:10011',
$this->channel2 = new Grpc\Channel('localhost:10007',
['credentials' => $channel_credentials]);
$channel2_info = $this->channel2->getChannelInfo();
$this->assertEquals(GRPC\CHANNEL_IDLE, $channel2_info['connectivity_status']);

Loading…
Cancel
Save