shreemaan-abhishek commented on PR #10156: URL: https://github.com/apache/apisix/pull/10156#issuecomment-1705947184
> The state is not correct. Do you mean `not correct` == `unhealthy`? Also, in the beginning, there will be no state as the healthcheck won't be triggered unless the upstream has been accessed. <img width="829" alt="image" src="https://github.com/apache/apisix/assets/61597896/0ce5c472-186b-4496-b56a-5c601775283b"> @monkeyDluffy6017 try running the following test case and check the servroot error logs and there you will find error logs even for positive outcomes. > t/stream-node/upstream-tls.t ``` use t::APISIX 'no_plan'; no_root_location(); add_block_preprocessor(sub { my ($block) = @_; if (!$block->http_config) { my $http_config = <<'_EOC_'; server { listen 8765 ssl; ssl_certificate ../../certs/mtls_server.crt; ssl_certificate_key ../../certs/mtls_server.key; ssl_client_certificate ../../certs/mtls_ca.crt; ssl_verify_client on; location /index { return 200 'gangnam style!'; } } server { listen 8766 ssl; ssl_certificate ../../certs/mtls_server.crt; ssl_certificate_key ../../certs/mtls_server.key; ssl_client_certificate ../../certs/mtls_ca.crt; ssl_verify_client on; location /index { return 200 'gangnam style!'; } } _EOC_ $block->set_value("http_config", $http_config); } if (!$block->request) { $block->set_value("request", "GET /t"); } }); run_tests; __DATA__ === TEST 7: https health check --- log_level: info --- config location /t { content_by_lua_block { local t = require("lib.test_admin") local core = require("apisix.core") local cert = t.read_file("t/certs/mtls_client.crt") local key = t.read_file("t/certs/mtls_client.key") local data = { retries = 2, checks = { active = { https_verify_certificate = false, healthy = { interval = 2, successes = 1 }, unhealthy = { interval = 1, http_failures = 2 }, type = "https", timeout = 5 }, }, type = "roundrobin", nodes = { ["127.0.0.1:8766"] = 1, ["127.0.0.1:8765"] = 1 }, scheme = "https", tls = { client_cert = cert, client_key = key } } local code, body = t.test('/apisix/admin/upstreams/1', ngx.HTTP_PUT, core.json.encode(data) ) if code >= 300 then ngx.status = code end local code, body = t.test('/apisix/admin/routes/1', ngx.HTTP_PUT, [[{ "upstream_id": 1, "uri": "/index" }]] ) if code >= 300 then ngx.status = code end } } --- error_code: 200 --- timeout: 15 === TEST 8: ACCESS --- pipelined_requests eval ["GET /index", "GET /index"] --- response_body eval ["gangnam style!", "gangnam style!"] --- error_code eval [200, 200] ``` P.S: I am unable to assert the `error_log` using the test case so you will have to check the log manually, if you change the error log to warn log, the test will pass signifying the successful working of the feature. -- 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]
