Fixes 2 issues:

1. In the State change test, 123->0 will hit a c-core GPR_ASSERT if
debugging is enabled because 123 doesn't map to a state that can
be printed.
2. In the Server test, 8888 is sometimes unavailable, so we just use
a wildcard port.
pull/8923/head
Ken Payson 8 years ago
parent d960c8b166
commit 02d2807b30
  1. 2
      src/php/tests/unit_tests/ChannelTest.php
  2. 4
      src/php/tests/unit_tests/ServerTest.php

@ -99,7 +99,7 @@ class ChannelTest extends PHPUnit_Framework_TestCase
$this->channel = new Grpc\Channel('localhost:0',
['credentials' => Grpc\ChannelCredentials::createInsecure()]);
$time = new Grpc\Timeval(1000);
$state = $this->channel->watchConnectivityState(123, $time);
$state = $this->channel->watchConnectivityState(1, $time);
$this->assertTrue($state);
unset($time);
}

@ -67,9 +67,9 @@ class ServerTest extends PHPUnit_Framework_TestCase
public function testRequestCall()
{
$this->server = new Grpc\Server();
$port = $this->server->addHttp2Port('0.0.0.0:8888');
$port = $this->server->addHttp2Port('0.0.0.0:0');
$this->server->start();
$channel = new Grpc\Channel('localhost:8888',
$channel = new Grpc\Channel('localhost:' . $port,
['credentials' => Grpc\ChannelCredentials::createInsecure()]);
$deadline = Grpc\Timeval::infFuture();

Loading…
Cancel
Save