Skip to content

Commit

Permalink
only wait full sync end when execute is successful
Browse files Browse the repository at this point in the history
  • Loading branch information
Oyami-Srk committed Feb 13, 2025
1 parent 33fcee1 commit be23573
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/internal/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ local function start_kong(env, tables, preserve_prefix, fixtures)
end

assert(render_fixtures(CONSTANTS.TEST_CONF_PATH .. nginx_conf, env, prefix, fixtures))
-- execute has at most 4 return values
local r1, r2, r3, r4 = shell.kong_exec("start --conf " .. CONSTANTS.TEST_CONF_PATH .. nginx_conf .. nginx_conf_flags, env)
-- execute with return = nil, so it will returns either (false, stderr) or (true, stderr, stdout).
local ok, stderr, stdout = shell.kong_exec("start --conf " .. CONSTANTS.TEST_CONF_PATH .. nginx_conf .. nginx_conf_flags, env)

-- Check if `start_kong` is used for starting a data plane with rpc sync
if env and
-- Check if `start_kong` is used for starting a data plane with rpc sync when executed successfully
if ok and env and
env.role and env.role == "data_plane" and
env.cluster_rpc_sync and env.cluster_rpc_sync == "on"
then
Expand All @@ -348,7 +348,7 @@ local function start_kong(env, tables, preserve_prefix, fixtures)
end, 20) -- wait 20 seconds for DP start
end

return r1, r2, r3, r4
return ok, stderr, stdout
end


Expand Down

0 comments on commit be23573

Please sign in to comment.