@@ -204,6 +204,8 @@ describe('Spanner', () => {
204204 libVersion : require ( '../../package.json' ) . version ,
205205 scopes : [ ] ,
206206 grpc,
207+ 'grpc.keepalive_time_ms' : 30000 ,
208+ 'grpc.keepalive_timeout_ms' : 10000 ,
207209 'grpc.callInvocationTransformer' :
208210 fakeGrpcGcp ( ) . gcpCallInvocationTransformer ,
209211 'grpc.channelFactoryOverride' : fakeGrpcGcp ( ) . gcpChannelFactoryOverride ,
@@ -251,6 +253,24 @@ describe('Spanner', () => {
251253 ) ;
252254 } ) ;
253255
256+ it ( 'should override grpc settings' , ( ) => {
257+ const keepaliveOptions = {
258+ 'grpc.keepalive_time_ms' : 300 ,
259+ 'grpc.keepalive_timeout_ms' : 100 ,
260+ } ;
261+ const options = extend ( { } , OPTIONS , keepaliveOptions ) ;
262+ const spanner = new Spanner ( options ) ;
263+ const expectedOptions = Object . assign (
264+ { } ,
265+ EXPECTED_OPTIONS ,
266+ keepaliveOptions
267+ ) ;
268+ assert . deepStrictEqual (
269+ getFake ( spanner . auth ) . calledWith_ [ 0 ] ,
270+ expectedOptions
271+ ) ;
272+ } ) ;
273+
254274 it ( 'should inherit from GrpcService' , ( ) => {
255275 assert ( spanner instanceof FakeGrpcService ) ;
256276
0 commit comments