Skip to content

Commit

Permalink
test(bigquery/storage/managedwriter): relax error checking (#6385)
Browse files Browse the repository at this point in the history
When a user issues a large request, the response from the
backend is a bare "InvalidArgument".  This PR removes additional
validation on information that is only attached when interrogating
the backend from a known client; it's stripped in the normal case.

Internal issue 239740070 was created to address the unactionable
nature of the response.

Fixes: #6361
  • Loading branch information
shollyman authored Jul 20, 2022
1 parent e8d8692 commit dd5714e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions bigquery/storage/managedwriter/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"fmt"
"math"
"strings"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -520,18 +519,10 @@ func testLargeInsert(ctx context.Context, t *testing.T, mwClient *Client, bqClie
if !ok {
t.Errorf("GetResult error was not an instance of ApiError")
}
if status := apiErr.GRPCStatus(); status.Code() != codes.InvalidArgument {
status := apiErr.GRPCStatus()
if status.Code() != codes.InvalidArgument {
t.Errorf("expected InvalidArgument status, got %v", status)
}

details := apiErr.Details()
if details.DebugInfo == nil {
t.Errorf("expected DebugInfo to be populated, was nil. apiError is %v, Unwrapped error is %T", apiErr, apiErr.Unwrap())
}
wantSubstring := "Message size exceed the limitation of byte based flow control."
if detail := details.DebugInfo.GetDetail(); !strings.Contains(detail, wantSubstring) {
t.Errorf("detail missing desired substring: %s", detail)
}
}
// send a subsequent append as verification we can proceed.
result, err = ms.AppendRows(ctx, [][]byte{b})
Expand Down

0 comments on commit dd5714e

Please sign in to comment.