@@ -300,33 +300,50 @@ func TestTLSACAConfig(t *testing.T) {
300300}
301301
302302func TestTimeouts (t * testing.T ) {
303- myViper .Set ("client.connection.timeout.peer.endorser" , "2s" )
304- myViper .Set ("client.connection.timeout.peer.eventhub" , "2m" )
305- myViper .Set ("client.connection.timeout.peer.eventreg" , "2h" )
306- myViper .Set ("client.connection.timeout.orderer" , "2ms" )
303+ myViper .Set ("client.endorserConnectionTimeout" , "2s" )
304+ myViper .Set ("client.eventServiceConnectionTimeout" , "2m" )
305+ myViper .Set ("client.eventRegistrationResponseTimeout" , "2h" )
306+ myViper .Set ("client.ordererConnectionTimeout" , "2ms" )
307+ myViper .Set ("client.queryResponseTimeout" , "7h" )
308+ myViper .Set ("client.executeTxResponseTimeout" , "8h" )
309+ myViper .Set ("client.ordererResponseTimeout" , "6s" )
307310
308311 t1 := configImpl .TimeoutOrDefault (api .Endorser )
309312 if t1 != time .Second * 2 {
310313 t .Fatalf ("Timeout not read correctly. Got: %s" , t1 )
311314 }
312- t2 := configImpl .TimeoutOrDefault (api .EventHub )
313- if t2 != time .Minute * 2 {
314- t .Fatalf ("Timeout not read correctly. Got: %s" , t2 )
315+ t1 = configImpl .TimeoutOrDefault (api .EventHub )
316+ if t1 != time .Minute * 2 {
317+ t .Fatalf ("Timeout not read correctly. Got: %s" , t1 )
318+ }
319+ t1 = configImpl .TimeoutOrDefault (api .EventReg )
320+ if t1 != time .Hour * 2 {
321+ t .Fatalf ("Timeout not read correctly. Got: %s" , t1 )
322+ }
323+ t1 = configImpl .TimeoutOrDefault (api .Query )
324+ if t1 != time .Hour * 7 {
325+ t .Fatalf ("Timeout not read correctly. Got: %s" , t1 )
326+ }
327+ t1 = configImpl .TimeoutOrDefault (api .ExecuteTx )
328+ if t1 != time .Hour * 8 {
329+ t .Fatalf ("Timeout not read correctly. Got: %s" , t1 )
315330 }
316- t3 : = configImpl .TimeoutOrDefault (api .EventReg )
317- if t3 != time .Hour * 2 {
318- t .Fatalf ("Timeout not read correctly. Got: %s" , t3 )
331+ t1 = configImpl .TimeoutOrDefault (api .OrdererConnection )
332+ if t1 != time .Millisecond * 2 {
333+ t .Fatalf ("Timeout not read correctly. Got: %s" , t1 )
319334 }
320- t4 : = configImpl .TimeoutOrDefault (api .Orderer )
321- if t4 != time .Millisecond * 2 {
322- t .Fatalf ("Timeout not read correctly. Got: %s" , t4 )
335+ t1 = configImpl .TimeoutOrDefault (api .OrdererResponse )
336+ if t1 != time .Second * 6 {
337+ t .Fatalf ("Timeout not read correctly. Got: %s" , t1 )
323338 }
339+
324340 // Test default
325- myViper .Set ("client.connection.timeout.orderer " , "" )
326- t5 : = configImpl .TimeoutOrDefault (api .Orderer )
327- if t5 != time .Second * 5 {
328- t .Fatalf ("Timeout not read correctly. Got: %s" , t5 )
341+ myViper .Set ("client.ordererConnectionTimeout " , "" )
342+ t1 = configImpl .TimeoutOrDefault (api .OrdererConnection )
343+ if t1 != time .Second * 5 {
344+ t .Fatalf ("Timeout not read correctly. Got: %s" , t1 )
329345 }
346+
330347}
331348
332349func TestOrdererConfig (t * testing.T ) {
0 commit comments