debugger and binding.b are blocking in rspec, and not binding.pry for instance

Open
#404 17 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
devtools, testing

Research direction

Start with the provided RSpec reproduction and compare the debugger and binding.b entry points with binding.pry while the background request is running. Check whether the preload setup affects the behavior; done means debugger and binding.b no longer block those requests in the reproduction.

Written by the indexing model from the issue text.

Description

enhancement

Your environment

  • ruby -v: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin20]
  • rdbg -v: rdbg 1.3.4

Describe the bug

When I do debugger or binding.b in my tests it blocks the background requests

To Reproduce

For instance:

require "rails_helper"

RSpec.describe "Approvals" do
  let!(:user) { create(:user) }
  let!(:approved_user) { create(:user) }

  before { create(:event, :approved, user: approved_user) }

  it "can approve events" do
    system_login_as(user)
    binding.b
  end
end

Expected behavior

Requests are not blocked, like what binding.pry does

Additional context

I'm using the preload, maybe that's related

Dominant language
Ruby
Stars
1.3k
Forks
146
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ruby/debug

All issues in ruby/debug

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.