@@ -304,9 +304,10 @@ def execute_dap_scenario scenario
304
304
@remote_info &.w &.close
305
305
end
306
306
307
- def execute_cdp_scenario scenario
307
+ def execute_cdp_scenario_ scenario
308
308
ENV [ 'RUBY_DEBUG_TEST_UI' ] = 'chrome'
309
309
310
+ @web_sock = nil
310
311
@remote_info = setup_tcpip_remote_debuggee
311
312
Timeout . timeout ( TIMEOUT_SEC ) do
312
313
sleep 0.001 until @remote_info . debuggee_backlog . join . include? @remote_info . port . to_s
@@ -329,6 +330,23 @@ def execute_cdp_scenario scenario
329
330
@remote_info &.w &.close
330
331
end
331
332
333
+ def execute_cdp_scenario scenario
334
+ retry_cnt = 0
335
+ begin
336
+ execute_cdp_scenario_ scenario
337
+ rescue Errno ::ECONNREFUSED
338
+ if ( retry_cnt += 1 ) > 10
339
+ STDERR . puts "retry #{ retry_cnt } but can not connect!"
340
+ raise
341
+ end
342
+
343
+ STDERR . puts "retry (#{ retry_cnt } ) connecting..."
344
+
345
+ sleep 0.3
346
+ retry
347
+ end
348
+ end
349
+
332
350
def req_disconnect
333
351
case get_target_ui
334
352
when 'vscode'
@@ -399,21 +417,7 @@ def attach_to_cdp_server
399
417
sleep 0.001 until @remote_info . debuggee_backlog . join . include? 'Disconnected.'
400
418
end
401
419
402
- retry_cnt = 0
403
- begin
404
- sock = Socket . tcp HOST , @remote_info . port
405
- rescue Errno ::ECONNREFUSED
406
- if ( retry_cnt += 1 ) > 20
407
- STDERR . puts "retry #{ retry_cnt } but can not connect..."
408
- raise
409
- end
410
-
411
- STDERR . puts "retry (#{ retry_cnt } ) connecting to #{ HOST } :#{ @remote_info . port } "
412
-
413
- sleep 0.3
414
- retry
415
- end
416
-
420
+ sock = Socket . tcp HOST , @remote_info . port
417
421
uuid = body [ 0 ] [ :id ]
418
422
419
423
Timeout . timeout ( TIMEOUT_SEC ) do
0 commit comments