Skip to content

Commit

Permalink
interop: build client without timeout; add logs to help debug failures (
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley authored Apr 5, 2022
1 parent e583b19 commit 337b815
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ jobs:
goversion: 1.18
testflags: -race

- type: extras
goversion: 1.18

- type: tests
goversion: 1.18
goarch: 386
Expand All @@ -70,6 +67,9 @@ jobs:
- type: tests
goversion: 1.15

- type: extras
goversion: 1.18

steps:
# Setup the environment.
- name: Setup GOARCH
Expand Down Expand Up @@ -114,8 +114,13 @@ jobs:
- name: Run extras tests
if: matrix.type == 'extras'
run: |
export TERM=${TERM:-xterm}
go version
echo -e "\n-- Running Examples --"
examples/examples_test.sh
echo -e "\n-- Running AdvancedTLS Examples --"
security/advancedtls/examples/examples_test.sh
echo -e "\n-- Running Interop Test --"
interop/interop_test.sh
echo -e "\n-- Running xDS E2E Test --"
xds/internal/test/e2e/run.sh
1 change: 1 addition & 0 deletions interop/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const (

func main() {
flag.Parse()
logger.Infof("Client running with test case %q", *testCase)
var useGDC bool // use google default creds
var useCEC bool // use compute engine creds
if *customCredentialsType != "" {
Expand Down
21 changes: 15 additions & 6 deletions interop/interop_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ clean () {
}

fail () {
echo "$(tput setaf 1) $1 $(tput sgr 0)"
echo "$(tput setaf 1) $(date): $1 $(tput sgr 0)"
clean
exit 1
}

pass () {
echo "$(tput setaf 2) $1 $(tput sgr 0)"
echo "$(tput setaf 2) $(date): $1 $(tput sgr 0)"
}

# Don't run some tests that need a special environment:
Expand Down Expand Up @@ -73,29 +73,38 @@ CASES=(
)

# Build server
echo "$(tput setaf 4) $(date): building server $(tput sgr 0)"
if ! go build -o /dev/null ./interop/server; then
fail "failed to build server"
else
pass "successfully built server"
fi

# Build client
echo "$(tput setaf 4) $(date): building client $(tput sgr 0)"
if ! go build -o /dev/null ./interop/client; then
fail "failed to build client"
else
pass "successfully built client"
fi

# Start server
SERVER_LOG="$(mktemp)"
go run ./interop/server --use_tls &> $SERVER_LOG &
GRPC_GO_LOG_SEVERITY_LEVEL=info go run ./interop/server --use_tls &> $SERVER_LOG &

for case in ${CASES[@]}; do
echo "$(tput setaf 4) testing: ${case} $(tput sgr 0)"
echo "$(tput setaf 4) $(date): testing: ${case} $(tput sgr 0)"

CLIENT_LOG="$(mktemp)"
if ! timeout 20 go run ./interop/client --use_tls --server_host_override=foo.test.google.fr --use_test_ca --test_case="${case}" &> $CLIENT_LOG; then
if ! GRPC_GO_LOG_SEVERITY_LEVEL=info timeout 20 go run ./interop/client --use_tls --server_host_override=foo.test.google.fr --use_test_ca --test_case="${case}" &> $CLIENT_LOG; then
fail "FAIL: test case ${case}
got server log:
$(cat $SERVER_LOG)
got client log:
$(cat $CLIENT_LOG)
"
else
pass "PASS: test case ${case}"
pass "PASS: test case ${case}"
fi
done

Expand Down
1 change: 1 addition & 0 deletions interop/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func main() {
if err != nil {
logger.Fatalf("failed to listen: %v", err)
}
logger.Infof("interop server listening on %v", lis.Addr())
var opts []grpc.ServerOption
if *useTLS {
if *certFile == "" {
Expand Down

0 comments on commit 337b815

Please sign in to comment.