Skip to content

Commit a86712c

Browse files
committed
remove extra scope in lieu of proper var order
1 parent 4f3d795 commit a86712c

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

google/cloud/spanner/internal/connection_impl_test.cc

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,18 +3262,17 @@ TEST(ConnectionImplTest, CommitSuccessExcludeFromChangeStreamsExplicitTxn) {
32623262
MakeLimitedTimeOptions()
32633263
.set<spanner::ExcludeTransactionFromChangeStreamsOption>(true));
32643264

3265-
// Introduce additional scope here to ensure that when txn is destroyed
3266-
// the session_pool contained by the Connection is still present, such that,
3267-
// the session associated with the transaction can be returned to the pool.
3268-
{
3269-
auto txn = spanner::Transaction(spanner::Transaction::ReadWriteOptions{});
3270-
auto commit = conn->Commit({txn, {}});
3271-
EXPECT_THAT(
3272-
commit,
3273-
IsOkAndHolds(Field(
3274-
&spanner::CommitResult::commit_timestamp,
3275-
Eq(spanner::MakeTimestamp(absl::FromUnixSeconds(123)).value()))));
3276-
}
3265+
// Make sure we create the Transaction after the Connection to ensure that
3266+
// when txn is destroyed the session_pool contained by the Connection is still
3267+
// present, such that, the session associated with the transaction can be
3268+
// returned to the pool.
3269+
auto txn = spanner::Transaction(spanner::Transaction::ReadWriteOptions{});
3270+
auto commit = conn->Commit({txn, {}});
3271+
EXPECT_THAT(
3272+
commit,
3273+
IsOkAndHolds(Field(
3274+
&spanner::CommitResult::commit_timestamp,
3275+
Eq(spanner::MakeTimestamp(absl::FromUnixSeconds(123)).value()))));
32773276
}
32783277

32793278
TEST(ConnectionImplTest, CommitSuccessWithMaxCommitDelay) {

0 commit comments

Comments
 (0)