hnlq715 commented on a change in pull request #3300:
URL: https://github.com/apache/apisix/pull/3300#discussion_r566017006
##########
File path: t/node/ewma.t
##########
@@ -215,3 +215,79 @@ GET /t
--- error_code: 200
--- no_error_log
[error]
+
+
+
+=== TEST 4: about filter tried servers
+--- timeout: 10
+--- config
+ location /t {
+ content_by_lua_block {
+ local t = require("lib.test_admin").test
+
+ --remove the 1981 node,
+ --add the 1984 node (invalid node)
+ --keep two nodes for triggering ewma logic in server_picker
function of balancer phase
+ local code, body = t('/apisix/admin/routes/1',
+ ngx.HTTP_PUT,
+ [[{
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1980": 1,
+ "127.0.0.1:1984": 1
+ },
+ "type": "ewma",
+ "timeout": {
+ "connect": 0.5,
+ "send": 0.5,
+ "read": 0.5
+ }
+ },
+ "uri": "/ewma"
+ }]]
+ )
+
+ if code ~= 200 then
+ ngx.say("update route failed")
+ return
+ end
+
+ local http = require "resty.http"
+ local uri = "http://127.0.0.1:" .. ngx.var.server_port
+ .. "/ewma"
+
+ --should select the 1980 node, because 1984 is invalid
Review comment:
To avoid misunderstand, I changed it to 8888
----------------------------------------------------------------
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]