@@ -164,50 +164,59 @@ for _, strategy in helpers.each_strategy() do
164
164
end )
165
165
end )
166
166
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 )
172
173
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 )
181
178
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
189
181
190
- admin_client :close ()
191
-
192
- helpers .wait_until (function ()
193
182
local http_client = helpers .http_client (' 127.0.0.1' , dp_status_port )
194
183
195
184
local res = http_client :send ({
196
185
method = " GET" ,
197
186
path = " /status/ready" ,
198
187
})
199
-
200
- local status = res and res .status
201
188
http_client :close ()
202
189
203
- if status == 200 then
204
- return true
205
- end
206
- end , 10 )
207
- end
208
- end )
209
- end )
210
190
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
211
220
end )
212
221
end -- for _, strategy
213
222
end -- for rpc_sync
0 commit comments