diff options
Diffstat (limited to 'src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php')
-rw-r--r-- | src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php b/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php index 2bb5c4bb85..5423368cdf 100644 --- a/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php +++ b/src/php/tests/unit_tests/PersistentChannelTests/PersistentChannelTest.php @@ -174,12 +174,12 @@ class PersistentListTest extends PHPUnit_Framework_TestCase public function testPersistentChannelSharedChannelClose() { // same underlying channel - $this->channel1 = new Grpc\Channel('localhost:10010', [ + $this->channel1 = new Grpc\Channel('localhost:10001', [ "grpc_target_persist_bound" => 2, ]); - $this->channel2 = new Grpc\Channel('localhost:10010', []); + $this->channel2 = new Grpc\Channel('localhost:10001', []); $this->server = new Grpc\Server([]); - $this->port = $this->server->addHttp2Port('localhost:10010'); + $this->port = $this->server->addHttp2Port('localhost:10001'); // channel2 can still be use $state = $this->channel2->getConnectivityState(); @@ -216,7 +216,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase public function testPersistentChannelTargetDefaultUpperBound() { - $this->channel1 = new Grpc\Channel('localhost:10011', []); + $this->channel1 = new Grpc\Channel('localhost:10002', []); $channel1_info = $this->channel1->getChannelInfo(); $this->assertEquals($channel1_info['target_upper_bound'], 1); $this->assertEquals($channel1_info['target_current_size'], 1); @@ -224,7 +224,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase public function testPersistentChannelTargetUpperBoundZero() { - $this->channel1 = new Grpc\Channel('localhost:10011', [ + $this->channel1 = new Grpc\Channel('localhost:10002', [ "grpc_target_persist_bound" => 0, ]); // channel1 will not be persisted. @@ -237,7 +237,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase public function testPersistentChannelTargetUpperBoundNotZero() { - $this->channel1 = new Grpc\Channel('localhost:10011', [ + $this->channel1 = new Grpc\Channel('localhost:10003', [ "grpc_target_persist_bound" => 3, ]); $channel1_info = $this->channel1->getChannelInfo(); @@ -245,7 +245,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase $this->assertEquals($channel1_info['target_current_size'], 1); // The upper bound should not be changed - $this->channel2 = new Grpc\Channel('localhost:10011', []); + $this->channel2 = new Grpc\Channel('localhost:10003', []); $channel2_info = $this->channel2->getChannelInfo(); $this->assertEquals($channel2_info['target_upper_bound'], 3); $this->assertEquals($channel2_info['target_current_size'], 1); @@ -253,14 +253,14 @@ class PersistentListTest extends PHPUnit_Framework_TestCase // The upper bound should not be changed $channel_credentials = Grpc\ChannelCredentials::createSsl(null, null, null); - $this->channel3 = new Grpc\Channel('localhost:10011', + $this->channel3 = new Grpc\Channel('localhost:10003', ['credentials' => $channel_credentials]); $channel3_info = $this->channel3->getChannelInfo(); $this->assertEquals($channel3_info['target_upper_bound'], 3); $this->assertEquals($channel3_info['target_current_size'], 2); // The upper bound should not be changed - $this->channel4 = new Grpc\Channel('localhost:10011', [ + $this->channel4 = new Grpc\Channel('localhost:10003', [ "grpc_target_persist_bound" => 5, ]); $channel4_info = $this->channel4->getChannelInfo(); @@ -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']); @@ -393,14 +393,14 @@ class PersistentListTest extends PHPUnit_Framework_TestCase public function testPersistentChannelTwoUpperBoundOutBound2() { - $this->channel1 = new Grpc\Channel('localhost:10011', [ + $this->channel1 = new Grpc\Channel('localhost:10012', [ "grpc_target_persist_bound" => 2, ]); $channel1_info = $this->channel1->getChannelInfo(); $channel_credentials = Grpc\ChannelCredentials::createSsl(null, null, null); - $this->channel2 = new Grpc\Channel('localhost:10011', + $this->channel2 = new Grpc\Channel('localhost:10012', ['credentials' => $channel_credentials]); $channel2_info = $this->channel2->getChannelInfo(); @@ -409,7 +409,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase $channel_credentials = Grpc\ChannelCredentials::createSsl("a", null, null); - $this->channel3 = new Grpc\Channel('localhost:10011', + $this->channel3 = new Grpc\Channel('localhost:10012', ['credentials' => $channel_credentials]); $channel3_info = $this->channel3->getChannelInfo(); @@ -422,14 +422,14 @@ class PersistentListTest extends PHPUnit_Framework_TestCase public function testPersistentChannelTwoUpperBoundOutBound3() { - $this->channel1 = new Grpc\Channel('localhost:10011', [ + $this->channel1 = new Grpc\Channel('localhost:10013', [ "grpc_target_persist_bound" => 2, ]); $channel1_info = $this->channel1->getChannelInfo(); $channel_credentials = Grpc\ChannelCredentials::createSsl(null, null, null); - $this->channel2 = new Grpc\Channel('localhost:10011', + $this->channel2 = new Grpc\Channel('localhost:10013', ['credentials' => $channel_credentials]); $this->channel2->getConnectivityState(true); $this->waitUntilNotIdle($this->channel2); @@ -442,7 +442,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase $channel_credentials = Grpc\ChannelCredentials::createSsl("a", null, null); - $this->channel3 = new Grpc\Channel('localhost:10011', + $this->channel3 = new Grpc\Channel('localhost:10013', ['credentials' => $channel_credentials]); $channel3_info = $this->channel3->getChannelInfo(); @@ -456,7 +456,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase public function testPersistentChannelTwoUpperBoundOutBound4() { - $this->channel1 = new Grpc\Channel('localhost:10011', [ + $this->channel1 = new Grpc\Channel('localhost:10014', [ "grpc_target_persist_bound" => 2, ]); $this->channel1->getConnectivityState(true); @@ -466,7 +466,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase $channel_credentials = Grpc\ChannelCredentials::createSsl(null, null, null); - $this->channel2 = new Grpc\Channel('localhost:10011', + $this->channel2 = new Grpc\Channel('localhost:10014', ['credentials' => $channel_credentials]); $this->channel2->getConnectivityState(true); $this->waitUntilNotIdle($this->channel2); @@ -475,7 +475,7 @@ class PersistentListTest extends PHPUnit_Framework_TestCase $channel_credentials = Grpc\ChannelCredentials::createSsl("a", null, null); - $this->channel3 = new Grpc\Channel('localhost:10011', + $this->channel3 = new Grpc\Channel('localhost:10014', ['credentials' => $channel_credentials]); $channel3_info = $this->channel3->getChannelInfo(); |