Skip to content

Commit

Permalink
tests(clustering): enable rpc sync for correlation-id (#14171)
Browse files Browse the repository at this point in the history
KAG-5561

---------

Co-authored-by: Chrono <chrono_cpp@me.com>
  • Loading branch information
lhanjian and chronolaw authored Jan 22, 2025
1 parent 91161d9 commit d80ff4b
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions spec/03-plugins/11-correlation-id/02-schema_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,33 @@ describe("Plugin: correlation-id (schema) #a [#" .. strategy .."]", function()
end)
end)

--- XXX FIXME: enable rpc_sync = on
for _, rpc_sync in ipairs { "off" } do
for _, v in ipairs({ {"off", "off"}, {"on", "off"}, {"on", "on"}, }) do
local rpc, rpc_sync = v[1], v[2]
describe("in hybrid mode" .. " rpc_sync=" .. rpc_sync, function()
local route

lazy_setup(function()
-- if the database is not cleared, the residual RPC connection information
-- between different tests will cause the test to fail.
local plugin_name = "correlation-id"
bp, db = helpers.get_db_utils(strategy, { "plugins", "workspaces", })
ws = db.workspaces:select_by_name("default")
plugin_id = uuid.generate_v4()
local sql = render([[
INSERT INTO plugins (id, name, config, enabled, ws_id) VALUES
('$(ID)', '$(PLUGIN_NAME)', $(CONFIG)::jsonb, TRUE, '$(WS_ID)');
COMMIT;
]], {
ID = plugin_id,
PLUGIN_NAME = plugin_name,
CONFIG = pgmoon_json.encode_json(plugin_config),
WS_ID = ws.id,
})

local res, err = db.connector:query(sql)
assert.is_nil(err)
assert.is_not_nil(res)

route = bp.routes:insert({
hosts = {"example.com"},
})
Expand Down Expand Up @@ -124,6 +146,7 @@ describe("Plugin: correlation-id (schema) #a [#" .. strategy .."]", function()
prefix = "servroot",
cluster_listen = "127.0.0.1:9005",
nginx_conf = "spec/fixtures/custom_nginx.template",
cluster_rpc = rpc,
cluster_rpc_sync = rpc_sync,
}))

Expand All @@ -136,6 +159,7 @@ describe("Plugin: correlation-id (schema) #a [#" .. strategy .."]", function()
cluster_control_plane = "127.0.0.1:9005",
proxy_listen = "0.0.0.0:9002",
status_listen = "127.0.0.1:9100",
cluster_rpc = rpc,
cluster_rpc_sync = rpc_sync,
}))
end)
Expand Down Expand Up @@ -189,5 +213,5 @@ describe("Plugin: correlation-id (schema) #a [#" .. strategy .."]", function()

end)
end)
end -- for rpc_sync
end -- for rpc, rpc_sync
end)

1 comment on commit d80ff4b

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Bazel Build

Docker image available kong/kong-dev:d80ff4b5ba4ab8fb5a50c3415a634801e45b5f29
Artifacts available https://github.com/Kong/kong/actions/runs/12900538248

Please sign in to comment.