Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Jan 10, 2025
1 parent 6632786 commit 8fb909b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions spec/02-integration/18-hybrid_rpc/06-batch-rpc_spec.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
local helpers = require "spec.helpers"
local cjson = require("cjson.safe")

-- register a test rpc service in custom plugin rpc-batch-test
for _, strategy in helpers.each_strategy() do
Expand Down Expand Up @@ -43,14 +42,14 @@ for _, strategy in helpers.each_strategy() do
describe("batch works", function()
it("DP calls CP via batching", function()
helpers.pwait_until(function()
assert.logfile("servroot2/logs/error.log").has.line(
"[rpc] sent batch RPC call: 1", true)

assert.logfile().has.line(
"[rpc] got batch RPC call: 1", true)
assert.logfile().has.line(
"kong.test.batch called: world", true)

assert.logfile("servroot2/logs/error.log").has.line(
"[rpc] sent batch RPC call: 1", true)

assert.logfile("servroot2/logs/error.log").has.line(
"[rpc] got batch RPC call: 1", true)
assert.logfile("servroot2/logs/error.log").has.line(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ function RpcBatchTestHandler:init_worker()

local worker_events = assert(kong.worker_events)

-- if rpc is ready we will start to sync
-- if rpc is ready we will start to batch call
worker_events.register(function(capabilities_list)
kong.rpc:set_batch(1)

local res, err = kong.rpc:call("control_plane", "kong.test.batch", "world")
local res = kong.rpc:call("control_plane", "kong.test.batch", "world")
if not res then
return
end
Expand Down

0 comments on commit 8fb909b

Please sign in to comment.