Merge pull request #20354 from stanley-cheung/php-update-memleak-test

PHP: update memory leak tests
pull/20363/head
Stanley Cheung 5 years ago committed by GitHub
commit 9e426b02ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      src/php/tests/MemoryLeakTest/MemoryLeakTest.php

@ -47,7 +47,7 @@ function waitUntilNotIdle($channel) {
}
// Set up
$channel = new Grpc\Channel('localhost:0', ['credentials' => Grpc\ChannelCredentials::createInsecure()]);
$channel = new Grpc\Channel('localhost:50101', ['credentials' => Grpc\ChannelCredentials::createInsecure()]);
// Test InsecureCredentials
assert('Grpc\Channel' == get_class($channel));
@ -56,28 +56,16 @@ assert('Grpc\Channel' == get_class($channel));
$state = $channel->getConnectivityState();
assert(0 == $state);
// Test GetConnectivityStateWithInt
$state = $channel->getConnectivityState(123);
assert(0 == $state);
// Test GetConnectivityStateWithString
$state = $channel->getConnectivityState('hello');
assert(0 == $state);
// Test GetConnectivityStateWithBool
$state = $channel->getConnectivityState(true);
assert(0 == $state);
$channel->close();
// Test GetTarget
$channel = new Grpc\Channel('localhost:8888', ['credentials' => Grpc\ChannelCredentials::createInsecure()]);
$channel = new Grpc\Channel('localhost:50102', ['credentials' => Grpc\ChannelCredentials::createInsecure()]);
$target = $channel->getTarget();
assert(is_string($target) == true);
$channel->close();
// Test WatchConnectivityState
$channel = new Grpc\Channel('localhost:0', ['credentials' => Grpc\ChannelCredentials::createInsecure()]);
$channel = new Grpc\Channel('localhost:50103', ['credentials' => Grpc\ChannelCredentials::createInsecure()]);
$now = Grpc\Timeval::now();
$deadline = $now->add(new Grpc\Timeval(100*1000));

Loading…
Cancel
Save