memory leak test for php

pull/17862/head
Jerry 6 years ago
parent 75bf7c7f48
commit 63544ea3ae
  1. 7
      src/php/bin/run_tests.sh
  2. 2300
      src/php/tests/MemoryLeakTest/MemoryLeakTest.php
  3. 10
      src/php/tests/unit_tests/CallTest.php
  4. 7
      templates/tools/dockerfile/php_valgrind.include
  5. 1
      templates/tools/dockerfile/test/php7_jessie_x64/Dockerfile.template
  6. 1
      templates/tools/dockerfile/test/php_jessie_x64/Dockerfile.template
  7. 7
      tools/dockerfile/test/php7_jessie_x64/Dockerfile
  8. 7
      tools/dockerfile/test/php_jessie_x64/Dockerfile

@ -28,3 +28,10 @@ php $extension_dir -d max_execution_time=300 $(which phpunit) -v --debug \
php $extension_dir -d max_execution_time=300 $(which phpunit) -v --debug \
../tests/unit_tests/PersistentChannelTests
export ZEND_DONT_UNLOAD_MODULES=1
export USE_ZEND_ALLOC=0
# Detect whether valgrind is executable
if [ -x "$(command -v valgrind)" ]; then
valgrind --error-exitcode=10 --leak-check=yes php $extension_dir -d max_execution_time=300 \
../tests/MemoryLeakTest/MemoryLeakTest.php
fi

File diff suppressed because it is too large Load Diff

@ -86,6 +86,16 @@ class CallTest extends PHPUnit_Framework_TestCase
$this->assertTrue($result->send_metadata);
}
public function testAddMultiAndMultiValueMetadata()
{
$batch = [
Grpc\OP_SEND_INITIAL_METADATA => ['key1' => ['value1', 'value2'],
'key2' => ['value3', 'value4'],],
];
$result = $this->call->startBatch($batch);
$this->assertTrue($result->send_metadata);
}
public function testGetPeer()
{
$this->assertTrue(is_string($this->call->getPeer()));

@ -0,0 +1,7 @@
#=================
# PHP Test dependencies
# Install dependencies
RUN apt-get update && apt-get install -y ${'\\'}
valgrind

@ -19,6 +19,7 @@
<%include file="../../php7_deps.include"/>
<%include file="../../gcp_api_libraries.include"/>
<%include file="../../python_deps.include"/>
<%include file="../../php_valgrind.include"/>
<%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]

@ -20,6 +20,7 @@
<%include file="../../gcp_api_libraries.include"/>
<%include file="../../python_deps.include"/>
<%include file="../../php_deps.include"/>
<%include file="../../php_valgrind.include"/>
<%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]

@ -79,6 +79,13 @@ RUN pip install --upgrade pip==10.0.1
RUN pip install virtualenv
RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0
#=================
# PHP Test dependencies
# Install dependencies
RUN apt-get update && apt-get install -y \
valgrind
RUN mkdir /var/local/jenkins

@ -76,6 +76,13 @@ RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 t
RUN apt-get update && apt-get install -y \
git php5 php5-dev phpunit unzip
#=================
# PHP Test dependencies
# Install dependencies
RUN apt-get update && apt-get install -y \
valgrind
RUN mkdir /var/local/jenkins

Loading…
Cancel
Save