zuiyangqingzhou commented on a change in pull request #4604:
URL: https://github.com/apache/apisix/pull/4604#discussion_r672957136
##########
File path: t/plugin/limit-conn2.t
##########
@@ -178,3 +178,76 @@ qr/request latency is/
--- grep_error_log_out
request latency is
request latency is
+
+
+
+=== TEST 5: set only_use_default_delay option to true in specific route
+--- config
+ location /t {
+ content_by_lua_block {
+ local t = require("lib.test_admin").test
+ local t = require("lib.test_admin").test
+ local code, body = t('/apisix/admin/global_rules/1',
+ ngx.HTTP_PUT,
+ [[{
+ "plugins": {
+ "limit-conn": {
+ "conn": 1,
+ "burst": 0,
+ "default_conn_delay": 0.3,
+ "rejected_code": 503,
+ "key": "remote_addr"
+ }
+ }
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ ngx.say(body)
+ return
+ end
+
+ local code, body = t('/apisix/admin/routes/1',
+ ngx.HTTP_PUT,
+ [[{
+ "uri": "/hello1",
+ "plugins": {
+ "limit-conn": {
+ "conn": 1,
+ "burst": 0,
+ "default_conn_delay": 0.3,
+ "only_use_default_delay": true,
+ "rejected_code": 503,
+ "key": "remote_addr"
+ }
+ },
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1982": 1
+ },
+ "type": "roundrobin"
+ }
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ end
+ ngx.say(body)
+ }
+ }
+--- response_body
+passed
+
+
+
+=== TEST 6: hit route
+--- log_level: debug
+--- request
+GET /hello1
+--- grep_error_log eval
+qr/request latency is/
Review comment:
I don't know exactly what you mean,
>
https://github.com/apache/apisix/pull/4604/files/47dc32979a94977aa8e3d0e73270dc88a9c43149#diff-2f0a07663e8e90e9f64519ee946aaf82729c8bb43e4f9100902e87d0a325f78eR251-R253
hasn't grep_error_log_out already check that the latency is nil?
Or would you give some guidance on how to do it ?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]