Skip to content

Commit

Permalink
tests(clustering): clean assertions in batch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Jan 16, 2025
1 parent ce15c78 commit 589cace
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
45 changes: 22 additions & 23 deletions spec/02-integration/18-hybrid_rpc/06-batch-rpc_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,33 @@ for _, strategy in helpers.each_strategy() do
local cp_logfile = nil
local dp_logfile = "servroot2/logs/error.log"

helpers.pwait_until(function()
assert.logfile(dp_logfile).has.line(
"[rpc] sent batch RPC call: 1", true)
assert.logfile(dp_logfile).has.line(
"[rpc] sent batch RPC call: 1", true, 10)

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

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

assert.logfile(dp_logfile).has.line(
"[rpc] sent batch RPC call: 2", true)
assert.logfile(dp_logfile).has.line(
"[rpc] sent batch RPC call: 2", true, 10)

assert.logfile(cp_logfile).has.line(
"[rpc] got batch RPC call: 2", true)
assert.logfile(cp_logfile).has.line(
"kong.test.batch called: kong", true)
assert.logfile(cp_logfile).has.line(
"kong.test.batch called: gateway", true)
assert.logfile(cp_logfile).has.line(
"[rpc] notification has no response", true)
assert.logfile(cp_logfile).has.line(
"[rpc] got batch RPC call: 2", true, 10)
assert.logfile(cp_logfile).has.line(
"kong.test.batch called: kong", true, 10)
assert.logfile(cp_logfile).has.line(
"kong.test.batch called: gateway", true, 10)
assert.logfile(cp_logfile).has.line(
"[rpc] notification has no response", true, 10)

return true
end, 15)
assert.logfile(dp_logfile).has.line(
"kong.test.batch ok", true, 10)
end)
end)
end)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function RpcBatchTestHandler:init_worker()
kong.rpc:notify("control_plane", "kong.test.batch", "kong")
kong.rpc:notify("control_plane", "kong.test.batch", "gateway")

ngx.log(ngx.DEBUG, "kong.test.batch ok")
end, "clustering:jsonrpc", "connected")
end

Expand Down

0 comments on commit 589cace

Please sign in to comment.