From 2323b1a06f493e6c8778891121942161f2167727 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Sun, 14 Jul 2024 15:53:42 +0800 Subject: [PATCH] feat: fix code --- spec/02-integration/05-proxy/24-buffered_spec.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/02-integration/05-proxy/24-buffered_spec.lua b/spec/02-integration/05-proxy/24-buffered_spec.lua index c95cd7266784c..e7fd0125c8100 100644 --- a/spec/02-integration/05-proxy/24-buffered_spec.lua +++ b/spec/02-integration/05-proxy/24-buffered_spec.lua @@ -1,6 +1,6 @@ local helpers = require "spec.helpers" local cjson = require "cjson" - +local http_mock = require "spec.helpers.http_mock" local md5 = ngx.md5 local TCP_PORT = helpers.get_available_port() @@ -255,8 +255,8 @@ for _, strategy in helpers.each_strategy() do -- to produce an nginx output filter error and status code 412 -- the response has to go through kong_error_handler (via error_page) it("remains healthy when if-match header is used with buffering", function() - local thread = helpers.tcp_server(TCP_PORT) - + mock = http_mock.new(TCP_PORT) + mock:start() local res = assert(proxy_client:send { method = "GET", path = "/0", @@ -265,9 +265,9 @@ for _, strategy in helpers.each_strategy() do } }) - thread:join() assert.response(res).has_status(412) assert.logfile().has.no.line("exited on signal 11") + mock:stop(true) end) end) end)