@@ -22,17 +22,29 @@ public static StandaloneClientConfigurationBuilder DefaultClientConfig() =>
22
22
new StandaloneClientConfigurationBuilder ( )
23
23
. WithAddress ( STANDALONE_HOSTS [ 0 ] . host , STANDALONE_HOSTS [ 0 ] . port )
24
24
. WithProtocolVersion ( ConnectionConfiguration . Protocol . RESP3 )
25
+ . WithRequestTimeout ( TimeSpan . FromSeconds ( 60 ) )
25
26
. WithTls ( TLS ) ;
26
27
27
28
public static ClusterClientConfigurationBuilder DefaultClusterClientConfig ( ) =>
28
29
new ClusterClientConfigurationBuilder ( )
29
30
. WithAddress ( CLUSTER_HOSTS [ 0 ] . host , CLUSTER_HOSTS [ 0 ] . port )
30
31
. WithProtocolVersion ( ConnectionConfiguration . Protocol . RESP3 )
32
+ . WithRequestTimeout ( TimeSpan . FromSeconds ( 60 ) )
33
+ . WithTls ( TLS ) ;
34
+
35
+ public static StandaloneClientConfigurationBuilder DefaultClientConfigLowTimeout ( ) =>
36
+ new StandaloneClientConfigurationBuilder ( )
37
+ . WithAddress ( STANDALONE_HOSTS [ 0 ] . host , STANDALONE_HOSTS [ 0 ] . port )
38
+ . WithProtocolVersion ( ConnectionConfiguration . Protocol . RESP3 )
39
+ . WithRequestTimeout ( TimeSpan . FromMilliseconds ( 250 ) )
31
40
. WithTls ( TLS ) ;
32
41
33
42
public static GlideClient DefaultStandaloneClient ( )
34
43
=> GlideClient . CreateClient ( DefaultClientConfig ( ) . Build ( ) ) . GetAwaiter ( ) . GetResult ( ) ;
35
44
45
+ public static GlideClient LowTimeoutStandaloneClient ( )
46
+ => GlideClient . CreateClient ( DefaultClientConfigLowTimeout ( ) . Build ( ) ) . GetAwaiter ( ) . GetResult ( ) ;
47
+
36
48
public static GlideClusterClient DefaultClusterClient ( )
37
49
=> GlideClusterClient . CreateClient ( DefaultClusterClientConfig ( ) . Build ( ) ) . GetAwaiter ( ) . GetResult ( ) ;
38
50
@@ -64,12 +76,14 @@ public static TheoryData<GlideClient> TestStandaloneClients
64
76
GlideClient resp2client = GlideClient . CreateClient (
65
77
DefaultClientConfig ( )
66
78
. WithProtocolVersion ( ConnectionConfiguration . Protocol . RESP2 )
79
+ . WithRequestTimeout ( TimeSpan . FromSeconds ( 60 ) )
67
80
. Build ( )
68
81
) . GetAwaiter ( ) . GetResult ( ) ;
69
82
resp2client . SetInfo ( "RESP2" ) ;
70
83
GlideClient resp3client = GlideClient . CreateClient (
71
84
DefaultClientConfig ( )
72
85
. WithProtocolVersion ( ConnectionConfiguration . Protocol . RESP3 )
86
+ . WithRequestTimeout ( TimeSpan . FromSeconds ( 60 ) )
73
87
. Build ( )
74
88
) . GetAwaiter ( ) . GetResult ( ) ;
75
89
resp3client . SetInfo ( "RESP3" ) ;
@@ -93,12 +107,14 @@ public static TheoryData<GlideClusterClient> TestClusterClients
93
107
GlideClusterClient resp2client = GlideClusterClient . CreateClient (
94
108
DefaultClusterClientConfig ( )
95
109
. WithProtocolVersion ( ConnectionConfiguration . Protocol . RESP2 )
110
+ . WithRequestTimeout ( TimeSpan . FromSeconds ( 60 ) )
96
111
. Build ( )
97
112
) . GetAwaiter ( ) . GetResult ( ) ;
98
113
resp2client . SetInfo ( "RESP2" ) ;
99
114
GlideClusterClient resp3client = GlideClusterClient . CreateClient (
100
115
DefaultClusterClientConfig ( )
101
116
. WithProtocolVersion ( ConnectionConfiguration . Protocol . RESP3 )
117
+ . WithRequestTimeout ( TimeSpan . FromSeconds ( 60 ) )
102
118
. Build ( )
103
119
) . GetAwaiter ( ) . GetResult ( ) ;
104
120
resp3client . SetInfo ( "RESP3" ) ;
@@ -128,6 +144,7 @@ public static ConfigurationOptions DefaultCompatibleConfig()
128
144
ConfigurationOptions config = new ( ) ;
129
145
config . EndPoints . Add ( STANDALONE_HOSTS [ 0 ] . host , STANDALONE_HOSTS [ 0 ] . port ) ;
130
146
config . Ssl = TLS ;
147
+ config . ResponseTimeout = 60000 ; // ms
131
148
return config ;
132
149
}
133
150
@@ -136,6 +153,7 @@ public static ConfigurationOptions DefaultCompatibleClusterConfig()
136
153
ConfigurationOptions config = new ( ) ;
137
154
config . EndPoints . Add ( CLUSTER_HOSTS [ 0 ] . host , CLUSTER_HOSTS [ 0 ] . port ) ;
138
155
config . Ssl = TLS ;
156
+ config . ResponseTimeout = 60000 ; // ms
139
157
return config ;
140
158
}
141
159
0 commit comments