Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(hybrid): enable incremental sync test in 11-status_spec.lua #13985

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions spec/02-integration/09-hybrid_mode/11-status_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)

Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could work but may not the best solution, since the case title is "should return 200 on data plane after configuring", and the status code is 503 when enabling inc_sync.

(inc_sync == "off" and status == 200)
then
return true
end
end, 10)
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

@chobits chobits Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before inserting an entity, it will return 503.
After inserting an entity, which makes the configuration non-empty, it will return 200.

The inserting-an-entity case is not added to this case currently.

(inc_sync == "off" and status == 200)
then
return true
end
end, 10)
Expand All @@ -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)

Expand Down
Loading