diff --git a/spanner/client_test.go b/spanner/client_test.go index 65b6802f5a30..dc056456af1e 100644 --- a/spanner/client_test.go +++ b/spanner/client_test.go @@ -3144,7 +3144,6 @@ func TestClient_ReadWriteTransactionConcurrentQueries(t *testing.T) { } rowCount++ } - return } wg.Add(2) go query(&firstTransactionID) @@ -4720,10 +4719,10 @@ func TestClient_EmulatorWithCredentialsFile(t *testing.T) { "localhost:1234", opts..., ) - defer client.Close() if err != nil { t.Fatalf("Failed to create a client with credentials file when running against an emulator: %v", err) } + defer client.Close() } func TestBatchReadOnlyTransaction_QueryOptions(t *testing.T) { diff --git a/spanner/session.go b/spanner/session.go index b6a0cc9d9538..3804d0aa4fe2 100644 --- a/spanner/session.go +++ b/spanner/session.go @@ -761,7 +761,6 @@ func newSessionPool(sc *sessionClient, config SessionPoolConfig) (*sessionPool, // wait for the session to be created case <-pool.mayGetMultiplexedSession: } - return }() } pool.recordStat(context.Background(), MaxAllowedSessionsCount, int64(config.MaxOpened)) diff --git a/spanner/transaction_test.go b/spanner/transaction_test.go index b428bbf64b1f..00b5509ab685 100644 --- a/spanner/transaction_test.go +++ b/spanner/transaction_test.go @@ -565,6 +565,10 @@ func TestReadWriteStmtBasedTransactionWithOptions(t *testing.T) { client, TransactionOptions{CommitOptions: CommitOptions{ReturnCommitStats: true}}, ) + if err != nil { + t.Fatalf("failed to create transaction: %v", err) + } + _, err = f(tx) if err != nil && status.Code(err) != codes.Aborted { tx.Rollback(ctx) @@ -592,6 +596,10 @@ func TestBatchDML_StatementBased_WithMultipleDML(t *testing.T) { defer teardown() tx, err := NewReadWriteStmtBasedTransaction(ctx, client) + if err != nil { + t.Fatalf("failed to create transaction: %v", err) + } + if _, err = tx.Update(ctx, Statement{SQL: UpdateBarSetFoo}); err != nil { tx.Rollback(ctx) t.Fatal(err) @@ -653,6 +661,10 @@ func TestPriorityInQueryOptions(t *testing.T) { defer teardown() tx, err := NewReadWriteStmtBasedTransaction(ctx, client) + if err != nil { + t.Fatalf("failed to create transaction: %v", err) + } + var iter *RowIterator iter = tx.txReadOnly.Query(ctx, NewStatement("SELECT 1")) err = iter.Do(func(r *Row) error { return nil })