| echo "Running multirequest test, args: $@" |
| ARGS="-d xdebug.profiler_enable=0 -d display_errors=on -dextension=../ext/google/protobuf/modules/protobuf.so" |
| RUN_UNDER="valgrind --error-exitcode=1" |
| EXTRA_ARGS=-dprotobuf.keep_descriptor_pool_after_request=1 |
| export ZEND_DONT_UNLOAD_MODULES=1 |
| nohup $RUN_UNDER php $ARGS $EXTRA_ARGS -S localhost:$PORT multirequest.php >nohup.out 2>&1 & |
| if ! timeout $TIMEOUT bash -c "until echo > /dev/tcp/localhost/$PORT; do sleep 0.1; done" > /dev/null 2>&1; then |
| echo "Server failed to come up after $TIMEOUT seconds" |
| seq 2 | xargs -I{} wget -nv http://localhost:$PORT/multirequest.result -O multirequest{}.result |
| if kill $PID > /dev/null 2>&1 && [[ $REQUESTS_SUCCEEDED == "0" ]]; then |
| echo "Multirequest test SUCCEEDED" |
| echo "Multirequest test FAILED" |
| run_test --keep_descriptors |
| run_test --valgrind --keep_descriptors |