@@ -211,7 +211,20 @@ func TestGlobalRateLimit(t *testing.T) {
211
211
log .Info ("Waiting for rules to propagate ..." )
212
212
time .Sleep (1 * time .Minute )
213
213
consumerPod , _ := util .GetPodName ("metaprotocol" , "app=dubbo-sample-consumer" , "" )
214
+
214
215
success := 0
216
+ for {
217
+ dubboResponse , _ := util .PodExec ("metaprotocol" , consumerPod , "dubbo-sample-consumer" ,
218
+ "curl -s 127.0.0.1:9009/hello" , false , "" )
219
+ response := "response from dubbo-sample-provider"
220
+ log .Info (dubboResponse )
221
+ if strings .Contains (dubboResponse , response ) {
222
+ success ++
223
+ break
224
+ }
225
+ time .Sleep (1 * time .Second )
226
+ }
227
+
215
228
for i := 0 ; i < 10 ; i ++ {
216
229
dubboResponse , _ := util .PodExec ("metaprotocol" , consumerPod , "dubbo-sample-consumer" ,
217
230
"curl -s 127.0.0.1:9009/hello" , false , "" )
@@ -222,8 +235,8 @@ func TestGlobalRateLimit(t *testing.T) {
222
235
}
223
236
}
224
237
225
- if success != 2 {
226
- t .Errorf ("global rate limit failed, want: %v got:%v " , 2 , success )
238
+ if success != 5 {
239
+ t .Errorf ("global rate limit failed, want: %v got:%v " , 5 , success )
227
240
} else {
228
241
t .Logf ("%v requests have been sent to server" , success )
229
242
}
0 commit comments