Skip to content

Commit

Permalink
Fix flakey test "test_reponse_returns_correct_threads_info"
Browse files Browse the repository at this point in the history
  • Loading branch information
ono-max authored and ko1 committed Mar 11, 2024
1 parent 98dad00 commit 3564601
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/protocol/catch_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ def test_set_exception_breakpoints_unsets_exception_breakpoints
run_protocol_scenario PROGRAM, cdp: false do
req_set_exception_breakpoints([{ name: "RuntimeError" }])
req_set_exception_breakpoints([])
req_continue
req_terminate_debuggee
end
end

def test_set_exception_breakpoints_accepts_condition
run_protocol_scenario PROGRAM, cdp: false do
req_set_exception_breakpoints([{ name: "RuntimeError", condition: "a == 2" }])
req_continue
req_terminate_debuggee
end

run_protocol_scenario PROGRAM, cdp: false do
Expand Down
2 changes: 1 addition & 1 deletion test/protocol/eval_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_eval_with_threads
req_add_breakpoint 9
req_continue
assert_repl_result({value: 'false', type: 'FalseClass'}, 'm.lock.nil?', frame_idx: 0)
req_continue
req_terminate_debuggee
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions test/support/protocol_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def req_continue
case get_target_ui
when 'vscode'
send_dap_request 'continue', threadId: 1
find_response :event, 'stopped', 'V<D'
when 'chrome'
send_cdp_request 'Debugger.resume'
res = find_response :method, 'Debugger.paused', 'C<D'
Expand All @@ -122,6 +123,7 @@ def req_step
case get_target_ui
when 'vscode'
send_dap_request 'stepIn', threadId: 1
find_response :event, 'stopped', 'V<D'
when 'chrome'
send_cdp_request 'Debugger.stepInto'
res = find_response :method, 'Debugger.paused', 'C<D'
Expand All @@ -133,6 +135,7 @@ def req_next
case get_target_ui
when 'vscode'
send_dap_request 'next', threadId: 1
find_response :event, 'stopped', 'V<D'
when 'chrome'
send_cdp_request 'Debugger.stepOver'
res = find_response :method, 'Debugger.paused', 'C<D'
Expand All @@ -144,6 +147,7 @@ def req_finish
case get_target_ui
when 'vscode'
send_dap_request 'stepOut', threadId: 1
find_response :event, 'stopped', 'V<D'
when 'chrome'
send_cdp_request 'Debugger.stepOut'
res = find_response :method, 'Debugger.paused', 'C<D'
Expand Down

0 comments on commit 3564601

Please sign in to comment.