zaunist commented on a change in pull request #6509:
URL: https://github.com/apache/apisix/pull/6509#discussion_r820328211



##########
File path: t/plugin/server-info.t
##########
@@ -65,58 +79,12 @@ location /t {
         ngx.say(json.encode(value))
     }
 }
---- request
-GET /t
 --- response_body eval
-qr/^{"boot_time":\d+,"etcd_version":"[\d\.]+","hostname":"[a-zA-Z\-0-9\.]+","id":[a-zA-Z\-0-9]+,"last_report_time":\d+,"up_time":\d+,"version":"[\d\.]+"}$/
---- no_error_log
-[error]
---- error_log
-timer created to report server info, interval: 60
-
-
-
-=== TEST 2: verify the data integrity after reloading
---- yaml_config
-apisix:
-    id: 123456
-plugins:
-    - server-info
-plugin_attr:
-    server-info:
-        report_interval: 60
---- config
-location /t {
-    content_by_lua_block {
-        local core = require("apisix.core")
-        local key = "/data_plane/server_info/" .. core.id.get()
-        local res, err = core.etcd.get(key)
-        if err ~= nil then
-            ngx.status = 500
-            ngx.say(err)
-            return
-        end
-
-        local value = res.body.node.value
-        if value.up_time >= 2 then
-            ngx.say("integral")
-        else
-            ngx.say("reset")
-        end
-    }
-}
---- request
-GET /t
---- response_body
-integral
---- no_error_log
-[error]
---- error_log
-timer created to report server info, interval: 60
+qr/^{"boot_time":\d+,"etcd_version":"[\d\.]+","hostname":"[a-zA-Z\-0-9\.]+","id":[a-zA-Z\-0-9]+,"version":"[\d\.]+"}$/

Review comment:
       In this change, we are using `keepalive` to replace the `put` operation, 
and testing keepalive requires verification of revision changes in etcd. 
However, since test-nginx reloads nginx every time you run a test, this may 
cause the revision to change, and I have not found a way to verify the 
keepalive.




-- 
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]


Reply via email to