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

use depth logging from the e2e package #4448

Merged
merged 2 commits into from
May 18, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions xds/internal/test/xds_server_serving_mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ func (s) TestServerSideXDS_ServingModeChanges(t *testing.T) {
t.Fatalf("rpc EmptyCall() failed: %v", err)
}

// Update the management server to remove the second listener resource. This should
// push the only the second listener into "not-serving" mode.
// Update the management server to remove the second listener resource. This
// should push only the second listener into "not-serving" mode.
if err := managementServer.Update(e2e.UpdateOptions{
NodeID: xdsClientNodeID,
Listeners: []*v3listenerpb.Listener{listener1},
Expand Down Expand Up @@ -240,8 +240,7 @@ func (s) TestServerSideXDS_ServingModeChanges(t *testing.T) {
// short timeout since we expect this to fail.
sCtx, sCancel := context.WithTimeout(ctx, defaultTestShortTimeout)
defer sCancel()
_, err = grpc.DialContext(sCtx, lis1.Addr().String(), grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials()))
if err == nil {
if _, err := grpc.DialContext(sCtx, lis1.Addr().String(), grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials())); err == nil {
t.Fatal("successfully created clientConn to a server in \"not-serving\" state")
}

Expand Down
20 changes: 16 additions & 4 deletions xds/internal/testutils/e2e/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,22 @@ var logger = grpclog.Component("xds-e2e")
// envoyproxy/go-control-plane/pkg/log. This is passed to the Snapshot cache.
type serverLogger struct{}

func (l serverLogger) Debugf(format string, args ...interface{}) { logger.Infof(format, args...) }
func (l serverLogger) Infof(format string, args ...interface{}) { logger.Infof(format, args...) }
func (l serverLogger) Warnf(format string, args ...interface{}) { logger.Warningf(format, args...) }
func (l serverLogger) Errorf(format string, args ...interface{}) { logger.Errorf(format, args...) }
func (l serverLogger) Debugf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
logger.InfoDepth(1, msg)
}
func (l serverLogger) Infof(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
logger.InfoDepth(1, msg)
}
func (l serverLogger) Warnf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
logger.WarningDepth(1, msg)
}
func (l serverLogger) Errorf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
logger.ErrorDepth(1, msg)
}

// ManagementServer is a thin wrapper around the xDS control plane
// implementation provided by envoyproxy/go-control-plane.
Expand Down