Skip to content

Commit

Permalink
test(bigquery/storage/managedwriter): address data race (#6249)
Browse files Browse the repository at this point in the history
Ironically, the test to do more concurrent things to trigger a specific
kind of race condition itself added a new kind of concurrency data race.

This switches from using shared variables for checking results to
goroutine-local versions.
  • Loading branch information
shollyman committed Jun 23, 2022
1 parent 8960408 commit 1bd770e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bigquery/storage/managedwriter/integration_test.go
Expand Up @@ -640,11 +640,11 @@ func testSchemaEvolution(ctx context.Context, t *testing.T, mwClient *Client, bq
for i := 0; i < 5; i++ {
wg.Add(1)
go func() {
result, err = ms.AppendRows(ctx, [][]byte{b}, UpdateSchemaDescriptor(descriptorProto))
res, err := ms.AppendRows(ctx, [][]byte{b}, UpdateSchemaDescriptor(descriptorProto))
if err != nil {
t.Errorf("failed evolved append: %v", err)
}
_, err = result.GetResult(ctx)
_, err = res.GetResult(ctx)
if err != nil {
t.Errorf("error on evolved append: %v", err)
}
Expand Down

0 comments on commit 1bd770e

Please sign in to comment.