membphis commented on a change in pull request #4610:
URL: https://github.com/apache/apisix/pull/4610#discussion_r670456910
##########
File path: t/node/upstream-discovery.t
##########
@@ -331,3 +331,35 @@ qr/proxy request to \S+/
--- grep_error_log_out
proxy request to 127.0.0.1:1979
proxy request to 0.0.0.0:1980
+
+
+
+=== TEST 7: bad nodes return by the discovery
+--- apisix_yaml
+routes:
+ -
+ uris:
+ - /hello
+ upstream_id: 1
+--- config
+ location /t {
+ content_by_lua_block {
+ local discovery = require("apisix.discovery.init").discovery
+ discovery.mock = {
+ nodes = function()
+ return {
+ {host = "127.0.0.1", port = 1980, weight = "0"},
+ }
+ end
+ }
+ local http = require "resty.http"
+ local uri = "http://127.0.0.1:" .. ngx.var.server_port .. "/hello"
+ local httpc = http.new()
+ local res, err = httpc:request_uri(uri, {method = "GET", keepalive
= false})
+ ngx.say(res.status)
+ }
+ }
+--- response_body
+503
+--- error_log
+invalid nodes format:
Review comment:
we need to confirm the content of the error message
--
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]