Skip to content
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
5 changes: 3 additions & 2 deletions internal/testutils/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ const DefaultChanBufferSize = 1

// Channel wraps a generic channel and provides a timed receive operation.
type Channel struct {
// C is the underlying channel on which values sent using the SendXxx() methods are delivered.
// Tests which cannot use ReceiveXxx() for whatever reasons can use C to read the values.
// C is the underlying channel on which values sent using the SendXxx()
// methods are delivered. Tests which cannot use ReceiveXxx() for whatever
// reasons can use C to read the values.
C chan any
}

Expand Down
3 changes: 0 additions & 3 deletions test/xds/xds_client_federation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,4 @@ func (s) TestFederation_UnknownAuthorityInReceivedResponse(t *testing.T) {
if got, want := status.Code(err), codes.Unavailable; got != want {
t.Fatalf("EmptyCall RPC returned status code: %v, want %v", got, want)
}
if wantErr := `failed to find authority "unknown-authority"`; !strings.Contains(err.Error(), wantErr) {
t.Fatalf("EmptyCall RPC returned error: %v, want %v", err, wantErr)
}
}
3 changes: 2 additions & 1 deletion xds/internal/xdsclient/tests/cds_watchers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/google/uuid"
"google.golang.org/grpc/internal/grpcsync"
"google.golang.org/grpc/internal/pretty"
"google.golang.org/grpc/internal/testutils"
"google.golang.org/grpc/internal/testutils/xds/e2e"
"google.golang.org/grpc/internal/xds/bootstrap"
Expand Down Expand Up @@ -130,7 +131,7 @@ func verifyNoClusterUpdate(ctx context.Context, updateCh *testutils.Channel) err
sCtx, sCancel := context.WithTimeout(ctx, defaultTestShortTimeout)
defer sCancel()
if u, err := updateCh.Receive(sCtx); err != context.DeadlineExceeded {
return fmt.Errorf("received unexpected ClusterUpdate when expecting none: %v", u)
return fmt.Errorf("received unexpected ClusterUpdate when expecting none: %s", pretty.ToJSON(u))
}
return nil
}
Expand Down
3 changes: 1 addition & 2 deletions xds/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,17 +697,16 @@ func (s) TestServeAndCloseDoNotRace(t *testing.T) {
}

wg := sync.WaitGroup{}
wg.Add(200)
for i := 0; i < 100; i++ {
server, err := NewGRPCServer(BootstrapContentsForTesting(generateBootstrapContents(t, uuid.NewString(), nonExistentManagementServer)))
if err != nil {
t.Fatalf("Failed to create an xDS enabled gRPC server: %v", err)
}
wg.Add(1)
go func() {
server.Serve(lis)
wg.Done()
}()
wg.Add(1)
go func() {
server.Stop()
wg.Done()
Expand Down