Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interop: build client without timeout; add logs to help debug failures #5294

Merged
merged 1 commit into from Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/testing.yml
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
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
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
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