examples: enable debugging to help determine why tests are hanging (#3166)

This commit is contained in:
Doug Fawley 2019-11-08 09:53:16 -08:00 committed by GitHub
parent 6071e7015f
commit caaa764950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 23 deletions

View File

@ -1,27 +1,27 @@
#!/bin/bash
#
# Copyright 2019 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Copyright 2019 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set +e
set +e -x
export TMPDIR=$(mktemp -d)
trap "rm -rf ${TMPDIR}" EXIT
clean () {
jobs -p | xargs pkill -P
jobs -p | xargs pkill -P
wait
}
@ -50,7 +50,7 @@ EXAMPLES=(
"features/name_resolving"
)
declare -A EXPECTED_SERVER_OUTPUT=(
declare -A EXPECTED_SERVER_OUTPUT=(
["helloworld"]="Received: world"
["route_guide"]=""
["features/authentication"]="server starting on port 50051..."
@ -69,8 +69,8 @@ declare -A EXPECTED_CLIENT_OUTPUT=(
["helloworld"]="Greeting: Hello world"
["route_guide"]="location:<latitude:416851321 longitude:-742674555 >"
["features/authentication"]="UnaryEcho: hello world"
["features/compression"]="UnaryEcho call returned \"compress\", <nil>"
["features/deadline"]="wanted = DeadlineExceeded, got = DeadlineExceeded"
["features/compression"]="UnaryEcho call returned \"compress\", <nil>"
["features/deadline"]="wanted = DeadlineExceeded, got = DeadlineExceeded"
["features/encryption/TLS"]="UnaryEcho: hello world"
["features/errors"]="Greeting: Hello world"
["features/interceptor"]="UnaryEcho: hello world"
@ -96,7 +96,7 @@ for example in ${EXAMPLES[@]}; do
else
pass "successfully built client"
fi
# Start server
SERVER_LOG="$(mktemp)"
go run ./examples/$example/*server/*.go &> $SERVER_LOG &
@ -126,7 +126,7 @@ for example in ${EXAMPLES[@]}; do
else
pass "server log contains expected output: ${EXPECTED_SERVER_OUTPUT[$example]}"
fi
fi
fi
# Check client log for expected output if expecting an
# output
@ -142,7 +142,6 @@ for example in ${EXAMPLES[@]}; do
pass "client log contains expected output: ${EXPECTED_CLIENT_OUTPUT[$example]}"
fi
fi
clean
done