spacewander commented on a change in pull request #3401: URL: https://github.com/apache/apisix/pull/3401#discussion_r563280989
########## File path: t/admin/upstream2.t ########## @@ -253,3 +253,36 @@ GET /index.html --- error_code: 502 --- error_log no valid upstream node + + + +=== TEST 9: upstream timeouts equal to zero +--- config + location /t { + content_by_lua_block { + local t = require("lib.test_admin").test + local code, body = t('/apisix/admin/upstreams/1', + ngx.HTTP_PUT, + [[{ + "nodes": { + "127.0.0.1:8080": 1 + }, + "type": "roundrobin", + "timeout": { + "connect": 0, + "send": 0, + "read": 0 + } + }]] + ) + ngx.status = code + ngx.print(body) + } + } +--- request +GET /t +--- error_code: 400 +--- response_body +{"error_msg":"invalid configuration: property \"timeout\" validation failed: property \"send\" validation failed: expected 0 to be sctrictly greater than 0"} Review comment: To make the test pass, need to use regex to match the response, like https://github.com/apache/apisix/blob/806ac668d5f2e1d8221c5b1916eee03880351c49/t/plugin/basic-auth.t#L65-L69 ---------------------------------------------------------------- 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