Skip to content

Commit

Permalink
test(bigquery/storage/managedwriter): improve instrumentation testing (
Browse files Browse the repository at this point in the history
…#6536)

* test(bigquery/storage/managedwriter): improve instrumentation testing

The integration testing for instrumentation can suffer from races, and
the failure mode here induces panic which incorrectly implicates other
tests run as part of the test group.

This small change avoid the indexing problem so that future failures
only implicate the instrumentation test.

Fixes: #6535
Fixes: #6534
Fixes: #6533
Fixes: #6532
Fixes: #6531
Fixes: #6530
Fixes: #6529
Fixes: #6528
Fixes: #6527
  • Loading branch information
shollyman committed Aug 17, 2022
1 parent 4169a66 commit 4aa43f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bigquery/storage/managedwriter/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,9 @@ func testInstrumentation(ctx context.Context, t *testing.T, mwClient *Client, bq
if err != nil {
t.Errorf("view %q RetrieveData: %v", tv.Name, err)
}
if len(metricData) > 1 {
t.Errorf("%q: only expected 1 row, got %d", tv.Name, len(metricData))
if mlen := len(metricData); mlen != 1 {
t.Errorf("%q: expected 1 row of metrics, got %d", tv.Name, mlen)
continue
}
if len(metricData[0].Tags) != 1 {
t.Errorf("%q: only expected 1 tag, got %d", tv.Name, len(metricData[0].Tags))
Expand Down

0 comments on commit 4aa43f9

Please sign in to comment.