Skip to content

The test framework for DAP sometimes raises "ArgumentError" #457

@ono-max

Description

@ono-max

Your environment

  • ruby -v:
    ruby 2.6.7p197 (2021-04-05 revision 67941) [x86_64-darwin20]

Describe the bug
The test framework for DAP sometimes raises "ArgumentError" as follows:

$ rake test_dap
/Users/naotto/workspace/debug/lib/debug/client.rb:178: warning: assigned but unused variable - e
Tests on local and remote. You can disable remote tests with RUBY_DEBUG_TEST_NO_REMOTE=1.
Loaded suite /Users/naotto/.rbenv/versions/2.6.7/lib/ruby/gems/2.6.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
....#<Thread:0x00007fae08856f48@/Users/naotto/workspace/debug/test/support/dap_utils.rb:152 run> terminated with exception (report_on_exception is true):
/Users/naotto/workspace/debug/test/support/dap_utils.rb:8:in `recv_request': wrong number of arguments (given 1, expected 2) (ArgumentError)
	from /Users/naotto/workspace/debug/test/support/dap_utils.rb:20:in `recv_request'
	from /Users/naotto/workspace/debug/test/support/dap_utils.rb:153:in `block in connect_to_dap_server'
F
================================================================================
Failure: test_hover_works_correctly(DEBUGGER__::HoverTest1638791703):
  -------------------------
  | All Protocol Messages |
  -------------------------

  V>D {"seq":1,"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"rdbg","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true},"type":"request"}
  V>D {"seq":2,"command":"attach","arguments":{"type":"rdbg","name":"Attach with rdbg","request":"attach","rdbgPath":"/Users/naotto/workspace/debug/exe/rdbg","debugPort":"/var/folders/kv/w1k6nh1x5fl7vx47b2pd005w0000gn/T/ruby-debug-sock-501/ruby-debug-naotto-8845","autoAttach":true,"__sessionId":"141d9c79-3669-43ec-ac1f-e62598c5a65a"},"type":"request"}
  V>D {"seq":3,"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request"}
  V>D {"seq":4,"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[{"filterId":"RuntimeError"}]},"type":"request"}
  V>D {"seq":5,"command":"configurationDone","type":"request"}

  --------------------------
  | Last Protocol Messages |
  --------------------------

  {
    "seq": 2,
    "command": "attach",
    "arguments": {
      "type": "rdbg",
      "name": "Attach with rdbg",
      "request": "attach",
      "rdbgPath": "/Users/naotto/workspace/debug/exe/rdbg",
      "debugPort": "/var/folders/kv/w1k6nh1x5fl7vx47b2pd005w0000gn/T/ruby-debug-sock-501/ruby-debug-naotto-8845",
      "autoAttach": true,
      "__sessionId": "141d9c79-3669-43ec-ac1f-e62598c5a65a"
    },
    "type": "request"
  }
  {
    "seq": 3,
    "command": "setFunctionBreakpoints",
    "arguments": {
      "breakpoints": [

      ]
    },
    "type": "request"
  }
  {
    "seq": 4,
    "command": "setExceptionBreakpoints",
    "arguments": {
      "filters": [

      ],
      "filterOptions": [
        {
          "filterId": "RuntimeError"
        }
      ]
    },
    "type": "request"
  }
  {
    "seq": 5,
    "command": "configurationDone",
    "type": "request"
  }

  --------------------
  | Debuggee Session |
  --------------------

  > EBUGGER: Debugger can attach via UNIX domain socket (/var/folders/kv/w1k6nh1x5fl7vx47b2pd005w0000gn/T/ruby-debug-sock-501/ruby-debug-naotto-18337-5)
  > DEBUGGER: Connected.


  -------------------
  | Failure Message |
  -------------------

  TIMEOUT ERROR (10 sec) while waiting for the following response.
  {
    "seq": 7,
    "type": "event",
    "event": "stopped",
    "body": {
      "reason": "pause",
      "threadId": 1,
      "allThreadsStopped": true
    }
  }.
/Users/naotto/workspace/debug/test/support/assertions.rb:79:in `assert_block'
/Users/naotto/workspace/debug/test/support/dap_utils.rb:255:in `rescue in run_dap_scenario'
/Users/naotto/workspace/debug/test/support/dap_utils.rb:254:in `run_dap_scenario'
/Users/naotto/workspace/debug/test/dap/hover_test.rb:17:in `test_hover_works_correctly'
     14:     RUBY
     15:
     16:     def test_hover_works_correctly
  => 17:       run_dap_scenario PROGRAM do
     18:         [
     19:           *INITIALIZE_MSG,
     20:           {
================================================================================
...
Finished in 19.179482 seconds.
--------------------------------------------------------------------------------
8 tests, 1862 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
87.5% passed
--------------------------------------------------------------------------------
0.42 tests/s, 97.08 assertions/s
rake aborted!
Command failed with status (1)

Tasks: TOP => test_dap

Expected behavior
It should not raise "ArgumentError".

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions