membphis commented on a change in pull request #2339:
URL: https://github.com/apache/apisix/pull/2339#discussion_r503172641



##########
File path: t/plugin/api-breaker.t
##########
@@ -464,15 +518,15 @@ passed
 
 
 
-=== TEST 17: max_breaker_seconds = 35
+=== TEST 18: add plugin, max_breaker_seconds = 17

Review comment:
       ![Uploading image.png…]()
   

##########
File path: t/plugin/api-breaker.t
##########
@@ -384,41 +390,89 @@ passed
 
 
 
-=== TEST 15: max_breaker_seconds = 20
+=== TEST 12: default value
+--- request
+GET /api_breaker?code=500
+--- error_code: 500
+--- no_error_log
+[error]
+
+
+
+=== TEST 13: trigger default value of unhealthy.http_statuses breaker
+--- request eval
+["GET /api_breaker?code=200", "GET /api_breaker?code=500", "GET 
/api_breaker?code=503", "GET /api_breaker?code=500", "GET 
/api_breaker?code=500", "GET /api_breaker?code=500"]
+--- error_code eval
+[200, 500, 503, 500, 500, 502]
+--- no_error_log
+[error]
+
+
+
+=== TEST 14: trigger timeout 2 second
+--- config
+    location /sleep1 {
+        proxy_pass "http://127.0.0.1:1980/sleep1";;
+    }
+--- request eval
+["GET /api_breaker?code=500", "GET /api_breaker?code=500", "GET 
/api_breaker?code=500", "GET /api_breaker?code=200", "GET /sleep1", "GET 
/sleep1", "GET /sleep1", "GET /api_breaker?code=200", "GET 
/api_breaker?code=200", "GET /api_breaker?code=200", "GET 
/api_breaker?code=200","GET /api_breaker?code=200"]
+--- error_code eval
+[500, 500, 500, 502, 200, 200, 200, 200, 200, 200, 200,200]
+--- no_error_log
+[error]
+
+
+
+=== TEST 15: trigger timeout again 4 second
+--- config
+    location /sleep1 {

Review comment:
       ditto

##########
File path: t/plugin/api-breaker.t
##########
@@ -384,41 +390,89 @@ passed
 
 
 
-=== TEST 15: max_breaker_seconds = 20
+=== TEST 12: default value
+--- request
+GET /api_breaker?code=500
+--- error_code: 500
+--- no_error_log
+[error]
+
+
+
+=== TEST 13: trigger default value of unhealthy.http_statuses breaker
+--- request eval
+["GET /api_breaker?code=200", "GET /api_breaker?code=500", "GET 
/api_breaker?code=503", "GET /api_breaker?code=500", "GET 
/api_breaker?code=500", "GET /api_breaker?code=500"]
+--- error_code eval
+[200, 500, 503, 500, 500, 502]
+--- no_error_log
+[error]
+
+
+
+=== TEST 14: trigger timeout 2 second
+--- config
+    location /sleep1 {

Review comment:
       do we really need it? please confirm!
   
   You are writing test cases, if the case is incorrect, it means your work is 
meaningless.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to