From 12f3042716d51fb0d7a23071d00a20f9751bac91 Mon Sep 17 00:00:00 2001 From: shollyman Date: Mon, 28 Jun 2021 10:50:55 -0700 Subject: [PATCH] fix(bigquery): update streaming insert error test (#4321) More backend changes appear to be inducing two forms of error message, depending on which component intercepts the error first. This test captures both outcomes (we always get an error). Co-authored-by: Tyler Bui-Palsulich <26876514+tbpg@users.noreply.github.com> --- bigquery/integration_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bigquery/integration_test.go b/bigquery/integration_test.go index 8b7b2a1e5ad..9bf2f91030e 100644 --- a/bigquery/integration_test.go +++ b/bigquery/integration_test.go @@ -1378,9 +1378,11 @@ func TestIntegration_InsertErrors(t *testing.T) { if !ok { t.Errorf("Wanted googleapi.Error, got: %v", err) } - want := "Request payload size exceeds the limit" - if !strings.Contains(e.Message, want) { - t.Errorf("Error didn't contain expected message (%s): %s", want, e.Message) + if e.Code != http.StatusRequestEntityTooLarge { + want := "Request payload size exceeds the limit" + if !strings.Contains(e.Message, want) { + t.Errorf("Error didn't contain expected message (%s): %#v", want, e) + } } // Case 2: Very Large Request // Request so large it gets rejected by intermediate infra (3x 10MB rows)