@@ -35,6 +35,7 @@ public class PooledSessionTests
3535 private static readonly TransactionOptions s_noneOptions = new TransactionOptions { } ;
3636 private static readonly ByteString s_transactionId = ByteString . CopyFromUtf8 ( "transaction" ) ;
3737 private static readonly TimeSpan s_releaseWaitTime = TimeSpan . FromSeconds ( 1 ) ;
38+ private static readonly CallSettings s_callSettings = CallSettings . FromCancellationToken ( default ) ;
3839
3940 public static TheoryData < TransactionOptions > NoTransactionOptionsData => new TheoryData < TransactionOptions >
4041 {
@@ -55,7 +56,7 @@ public async Task NoTransactionOptions(TransactionOptions options)
5556 . ExecuteSqlAsync ( Arg . Any < ExecuteSqlRequest > ( ) , Arg . Any < CallSettings > ( ) )
5657 . Returns ( Task . FromResult ( new ResultSet ( ) ) ) ;
5758
58- await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , default ) ;
59+ await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , s_callSettings ) ;
5960
6061 await client . Received ( 1 ) . ExecuteSqlAsync (
6162 Arg . Do < ExecuteSqlRequest > ( request =>
@@ -78,7 +79,7 @@ public async Task SingleUseTransactionOptions()
7879 . ExecuteSqlAsync ( Arg . Any < ExecuteSqlRequest > ( ) , Arg . Any < CallSettings > ( ) )
7980 . Returns ( Task . FromResult ( new ResultSet ( ) ) ) ;
8081
81- await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , default ) ;
82+ await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , s_callSettings ) ;
8283
8384 await client . Received ( 1 ) . ExecuteSqlAsync (
8485 Arg . Do < ExecuteSqlRequest > ( request =>
@@ -100,7 +101,7 @@ public async Task ExplicitTransaction()
100101 . ExecuteSqlAsync ( Arg . Any < ExecuteSqlRequest > ( ) , Arg . Any < CallSettings > ( ) )
101102 . Returns ( Task . FromResult ( new ResultSet ( ) ) ) ;
102103
103- await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , default ) ;
104+ await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , s_callSettings ) ;
104105
105106 await client . Received ( 1 ) . ExecuteSqlAsync (
106107 Arg . Do < ExecuteSqlRequest > ( request =>
@@ -129,7 +130,7 @@ public async Task InlinedTransaction()
129130 }
130131 } ) ) ;
131132
132- await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , default ) ;
133+ await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , s_callSettings ) ;
133134
134135 Assert . Equal ( s_transactionId , pooledSession . TransactionId ) ;
135136
@@ -140,6 +141,7 @@ await client.Received(1).ExecuteSqlAsync(
140141 Assert . Equal ( s_readWriteOptions , request . Transaction . Begin ) ;
141142 } ) ,
142143 Arg . Any < CallSettings > ( ) ) ;
144+ await client . DidNotReceive ( ) . BeginTransactionAsync ( Arg . Any < BeginTransactionRequest > ( ) , Arg . Any < CallSettings > ( ) ) ;
143145 }
144146
145147 [ Fact ]
@@ -157,7 +159,7 @@ public async Task ReleaseToPool_FurtherRpcsInvalid()
157159
158160 // We now can't make RPCs
159161 await Assert . ThrowsAsync < ObjectDisposedException > (
160- ( ) => pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , default ) ) ;
162+ ( ) => pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , s_callSettings ) ) ;
161163
162164 await client . DidNotReceive ( ) . ExecuteSqlAsync ( Arg . Any < ExecuteSqlRequest > ( ) , Arg . Any < CallSettings > ( ) ) ;
163165 await client . DidNotReceive ( ) . RollbackAsync ( Arg . Any < RollbackRequest > ( ) , Arg . Any < CallSettings > ( ) ) ;
@@ -200,7 +202,7 @@ public async Task ReleaseToPool_CommittedTransactionNotRolledBack()
200202 . CommitAsync ( Arg . Any < CommitRequest > ( ) , Arg . Any < CallSettings > ( ) )
201203 . Returns ( Task . FromResult ( new CommitResponse ( ) ) ) ;
202204
203- await pooledSession . CommitAsync ( new CommitRequest ( ) , null ) ;
205+ await pooledSession . CommitAsync ( new CommitRequest ( ) , s_callSettings ) ;
204206 await client . Received ( 1 ) . CommitAsync (
205207 Arg . Do < CommitRequest > ( request =>
206208 Assert . Equal ( s_transactionId , request . TransactionId ) ) ,
@@ -224,7 +226,7 @@ public async Task ReleaseToPool_RolledBackTransactionNotRolledBack()
224226 . RollbackAsync ( Arg . Any < RollbackRequest > ( ) , Arg . Any < CallSettings > ( ) )
225227 . Returns ( Task . FromResult ( new CommitResponse ( ) ) ) ;
226228
227- await pooledSession . RollbackAsync ( new RollbackRequest ( ) , null ) ;
229+ await pooledSession . RollbackAsync ( new RollbackRequest ( ) , s_callSettings ) ;
228230 await client . Received ( 1 ) . RollbackAsync (
229231 Arg . Do < RollbackRequest > ( request =>
230232 Assert . Equal ( s_transactionId , request . TransactionId ) ) ,
@@ -260,7 +262,7 @@ public async Task ReleaseToPool_ReadWriteUncommittedTransactionRolledBack()
260262 . RollbackAsync ( Arg . Any < RollbackRequest > ( ) , Arg . Any < CallSettings > ( ) )
261263 . Returns ( Task . FromResult ( new CommitResponse ( ) ) ) ;
262264
263- await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , Arg . Any < CallSettings > ( ) ) ;
265+ await pooledSession . ExecuteSqlAsync ( new ExecuteSqlRequest ( ) , s_callSettings ) ;
264266 await client . Received ( 1 ) . ExecuteSqlAsync (
265267 Arg . Do < ExecuteSqlRequest > ( request =>
266268 {
0 commit comments