From 7e5efe555890ae85f39ed64218011cd566f8dd11 Mon Sep 17 00:00:00 2001 From: Maksim Tiushev Date: Wed, 15 Jul 2026 11:43:27 +0300 Subject: [PATCH] test: fix HTTP address reload check Connecting to 0.0.0.0 is environment-dependent. On Linux it may reach a listener on 127.0.0.1, so the test can fail even when the server is recreated with the expected address. This patch verifies the host and port kept by roles.httpd after reload. The existing HTTP request checks that the recreated server is running. Closes #228 --- test/integration/httpd_role_test.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/integration/httpd_role_test.lua b/test/integration/httpd_role_test.lua index 36dc92b..d00e2e0 100644 --- a/test/integration/httpd_role_test.lua +++ b/test/integration/httpd_role_test.lua @@ -170,7 +170,16 @@ g.test_change_server_addr_on_the_run = function(cg) local _, err = cg.server:eval("require('config'):reload()") t.assert_not(err) - t.assert_not(helpers.tcp_connection_exists('0.0.0.0', 13001)) + t.assert_equals(cg.server:eval([[ + local httpd = require('roles.httpd').get_server('additional') + return { + host = httpd.host, + port = httpd.port, + } + ]]), { + host = 'localhost', + port = 13001, + }) resp = http_client:get('http://localhost:13001/ping') t.assert_equals(resp.status, 200, 'response not 200') t.assert_equals(resp.body, 'pong')