Skip to content

Commit 94557b4

Browse files
committed
update
1 parent daf4dac commit 94557b4

File tree

1 file changed

+41
-32
lines changed

1 file changed

+41
-32
lines changed

spec/02-integration/09-hybrid_mode/11-status_spec.lua

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -164,50 +164,59 @@ for _, strategy in helpers.each_strategy() do
164164
end)
165165
end)
166166

167-
describe("dp status ready when rpc_sync == on", function()
168-
lazy_setup(function()
169-
assert(start_kong_cp())
170-
assert(start_kong_dp())
171-
end)
167+
if rpc == "on" and rpc_sync == "on" then
168+
describe("dp status ready when rpc_sync == on", function()
169+
lazy_setup(function()
170+
assert(start_kong_cp())
171+
assert(start_kong_dp())
172+
end)
172173

173-
lazy_teardown(function()
174-
assert(helpers.stop_kong("serve_cp"))
175-
assert(helpers.stop_kong("serve_dp"))
176-
end)
177-
178-
it("should return 200 on data plane after configuring when rpc_sync == on ", function()
179-
-- insert one entity to make dp ready for incremental sync
180-
if rpc == "on" and rpc_sync == "on" then
174+
lazy_teardown(function()
175+
assert(helpers.stop_kong("serve_cp"))
176+
assert(helpers.stop_kong("serve_dp"))
177+
end)
181178

182-
print("+++++ post /services")
183-
local admin_client = helpers.admin_client(10000)
184-
local res = assert(admin_client:post("/services", {
185-
body = { name = "service-001", url = "https://127.0.0.1:15556/request", },
186-
headers = {["Content-Type"] = "application/json"}
187-
}))
188-
assert.res_status(201, res)
179+
it("should return 200 on data plane after configuring when rpc_sync == on ", function()
180+
-- insert one entity to make dp ready for incremental sync
189181

190-
admin_client:close()
191-
192-
helpers.wait_until(function()
193182
local http_client = helpers.http_client('127.0.0.1', dp_status_port)
194183

195184
local res = http_client:send({
196185
method = "GET",
197186
path = "/status/ready",
198187
})
199-
200-
local status = res and res.status
201188
http_client:close()
202189

203-
if status == 200 then
204-
return true
205-
end
206-
end, 10)
207-
end
208-
end)
209-
end)
210190

191+
192+
193+
local admin_client = helpers.admin_client(10000)
194+
local res = assert(admin_client:post("/services", {
195+
body = { name = "service-001", url = "https://127.0.0.1:15556/request", },
196+
headers = {["Content-Type"] = "application/json"}
197+
}))
198+
assert.res_status(201, res)
199+
200+
admin_client:close()
201+
202+
helpers.wait_until(function()
203+
local http_client = helpers.http_client('127.0.0.1', dp_status_port)
204+
205+
local res = http_client:send({
206+
method = "GET",
207+
path = "/status/ready",
208+
})
209+
210+
local status = res and res.status
211+
http_client:close()
212+
213+
if status == 200 then
214+
return true
215+
end
216+
end, 10)
217+
end)
218+
end)
219+
end
211220
end)
212221
end -- for _, strategy
213222
end -- for rpc_sync

0 commit comments

Comments
 (0)