Skip to content

Commit

Permalink
fix 07-sdk/03-cluster_spec.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Sep 26, 2024
1 parent a340e7a commit 80e76c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ function _M:sync_once(delay)
crud_events[crud_events_n] = { delta.type, "delete", old_entity, }
end

if delta.version ~= version then
-- XXX TODO: could delta.version be nil or ngx.null
if type(delta.version) == "number" and delta.version ~= version then
version = delta.version
end
end
Expand Down
8 changes: 6 additions & 2 deletions spec/02-integration/07-sdk/03-cluster_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ fixtures_cp.http_mock.my_server_block = [[
}
]]

for _, inc_sync in ipairs { "on", "off" } do
for _, strategy in helpers.each_strategy() do
describe("PDK: kong.cluster for #" .. strategy, function()
describe("PDK: kong.cluster for #" .. strategy .. " inc_sync=" .. inc_sync, function()
local proxy_client

lazy_setup(function()
Expand All @@ -61,6 +62,7 @@ for _, strategy in helpers.each_strategy() do
db_update_frequency = 0.1,
cluster_listen = "127.0.0.1:9005",
nginx_conf = "spec/fixtures/custom_nginx.template",
cluster_incremental_sync = inc_sync,
}, nil, nil, fixtures_cp))

assert(helpers.start_kong({
Expand All @@ -72,6 +74,7 @@ for _, strategy in helpers.each_strategy() do
cluster_control_plane = "127.0.0.1:9005",
proxy_listen = "0.0.0.0:9002",
nginx_conf = "spec/fixtures/custom_nginx.template",
cluster_incremental_sync = inc_sync,
}, nil, nil, fixtures_dp))
end)

Expand Down Expand Up @@ -108,4 +111,5 @@ for _, strategy in helpers.each_strategy() do
end, 10)
end)
end)
end
end -- for _, strategy
end -- for inc_sync

0 comments on commit 80e76c9

Please sign in to comment.