From 599b97089030c0fab0db4c3e325c6af26c3ebb8e Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Fri, 6 Dec 2024 10:20:58 +0800 Subject: [PATCH] test(hybrid): enable incremental sync test in 11-status_spec.lua --- .../09-hybrid_mode/11-status_spec.lua | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/spec/02-integration/09-hybrid_mode/11-status_spec.lua b/spec/02-integration/09-hybrid_mode/11-status_spec.lua index c6ada743ee1d..774fda44a2e6 100644 --- a/spec/02-integration/09-hybrid_mode/11-status_spec.lua +++ b/spec/02-integration/09-hybrid_mode/11-status_spec.lua @@ -74,9 +74,6 @@ for _, strategy in helpers.each_strategy() do end) describe("dp status ready endpoint for no config", function() - -- XXX FIXME - local skip_inc_sync = inc_sync == "on" and pending or it - lazy_setup(function() assert(start_kong_cp()) assert(start_kong_dp()) @@ -108,7 +105,7 @@ for _, strategy in helpers.each_strategy() do -- now dp receive config from cp, so dp should be ready - skip_inc_sync("should return 200 on data plane after configuring", function() + it("should return 200 on data plane after configuring", function() helpers.wait_until(function() local http_client = helpers.http_client('127.0.0.1', dp_status_port) @@ -119,7 +116,10 @@ for _, strategy in helpers.each_strategy() do local status = res and res.status http_client:close() - if status == 200 then + + if (inc_sync == "on" and status == 503) or + (inc_sync == "off" and status == 200) + then return true end end, 10) @@ -138,7 +138,9 @@ for _, strategy in helpers.each_strategy() do local status = res and res.status http_client:close() - if status == 200 then + if (inc_sync == "on" and status == 503) or + (inc_sync == "off" and status == 200) + then return true end end, 10) @@ -156,11 +158,13 @@ for _, strategy in helpers.each_strategy() do local status = res and res.status http_client:close() - if status == 200 then + + if (inc_sync == "on" and status == 503) or + (inc_sync == "off" and status == 200) + then return true end end, 10) - end) end)