moonming commented on a change in pull request #2465:
URL: https://github.com/apache/apisix/pull/2465#discussion_r539369129
##########
File path: t/plugin/limit-conn.t
##########
@@ -1207,9 +1207,9 @@ qr/limit key: consumer_jackroute&consumer\d+/
content_by_lua_block {
local plugin = require("apisix.plugins.limit-conn")
local ok, err = plugin.check_schema({
- conn = 1,
- default_conn_delay = 0.1,
- rejected_code = 503,
+ conn = 1,
+ default_conn_delay = 0.1,
+ rejected_code = 503,
Review comment:
why modify this test case?
##########
File path: t/plugin/limit-conn.t
##########
@@ -1225,3 +1225,61 @@ property "burst" is required
done
--- no_error_log
[error]
+
+
+
+=== TEST 32: enable plugin: conn=1
+--- config
+ location /t {
+ content_by_lua_block {
+ local t = require("lib.test_admin").test
+ local code, body = t('/apisix/admin/routes/1',
+ ngx.HTTP_PUT,
+ [[{
+ "plugins": {
+ "limit-conn": {
+ "conn": 1,
+ "burst": 0,
+ "default_conn_delay": 0.3,
+ "rejected_code": 503,
+ "key": "remote_addr"
+ }
+ },
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1980": 1
+ },
+ "type": "roundrobin"
+ },
+ "uri": "/hello"
+ }]]
+ )
+ if code >= 300 then
+ ngx.status = code
+ end
+ ngx.say(body)
+ }
+ }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 33: hit route and should not be limited
+--- pipelined_requests eval
Review comment:
Shouldn't the request be rejected here? I did not understand
----------------------------------------------------------------
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:
[email protected]