Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threads run in the context of pry/byebug hang in >= 2.0.0 #51

Closed
travisp opened this issue Jan 30, 2015 · 14 comments
Closed

Threads run in the context of pry/byebug hang in >= 2.0.0 #51

travisp opened this issue Jan 30, 2015 · 14 comments

Comments

@travisp
Copy link

travisp commented Jan 30, 2015

On pry-byebug 1.3.3:

[1] pry(#<RSpec::Core::ExampleGroup::Nested_1>)> x = Thread.new { sleep 0.1; print "x"; print "y"; print "z" } => #<Thread:0x007fbfbb0337c0@(pry):1 sleep> [2] pry(#<RSpec::Core::ExampleGroup::Nested_1>)> x.join xyz=> #<Thread:0x007fbfbb0337c0@(pry):1 dead>

On pry-byebug 2.0.0:
[1] pry(#<RSpec::Core::ExampleGroup::Nested_1>)> x = Thread.new { sleep 0.1; print "x"; print "y"; print "z" } => #<Thread:0x007f807dd83600@(pry):1 sleep> [2] pry(#<RSpec::Core::ExampleGroup::Nested_1>)> x.join
^^ hangs indefinitely

We noticed this while trying to access a connection in capybara-webkit, where threads are used in the connection code: thoughtbot/capybara-webkit#718

@travisp
Copy link
Author

travisp commented Jan 30, 2015

More specifically, the above threads work on pry-byebug commit 5c72fb5, but not 2 commits later b0eba72 (I can't test the commit in the middle because I get exceptions). It appears to be that it's simply of a matter of whether Byebug.start has been called or not (in the earlier version, Byebug.start was not called initially). Even on the earlier version, once the user has entered a command such as next, any threads hang.

@deivid-rodriguez
Copy link
Owner

Could you try to reproduce this using latest pry-byebug and byebug (from master). I think it should be fixed in byebug.

@travisp
Copy link
Author

travisp commented Feb 22, 2015

@deivid-rodriguez Unfortunately it seems that in pry-byebug master 917c365 and byebug master 99bd3269deb790 the problem still remains.

@deivid-rodriguez
Copy link
Owner

You means the problem remains separately in byebug´s master or using pry-byebug (master) + byebug (master).

@olivierlacan
Copy link
Contributor

@deivid-rodriguez Running both byebug master and pry-byebug master I'm still seeing hangs inside of capybara-webkit threads as well. Is there anything that could help you with this issue?

Basic setup I have is rspec with Capybara and capybara-webkit.
In spec_helper.rb:

Capybara.javascript_driver = :webkit

RSpec.configure do |config|
#...
  config.around(:each, js: true) do |example|
    Capybara.using_driver(:webkit, &example)
  end
end

In the spec itself:

require 'spec_helper'

describe 'Something', js: true do
  it 'does something' do
    before do
      binding.pry
    end
  end
end

Running the spec, when the Pry session starts, any call to find('#selector') hangs indefinitely.

@deivid-rodriguez
Copy link
Owner

Are you able to reproduce using byebug master only?

@olivierlacan
Copy link
Contributor

@deivid-rodriguez Yep. That's what I did originally. I had the last release of pry-byebug I think and byebug master.

@deivid-rodriguez
Copy link
Owner

@olivierlacan Did you uninstall pry-byebug, installed byebug's master branch and then reproduced this using byebug instead of binding.pry?

If that's the case, open an issue in byebug's repo?

@travisp
Copy link
Author

travisp commented Mar 7, 2015

@deivid-rodriguez I tested again with the latest (after 091cff) in byebug. With byebug alone the problem does not seem to exist. With pry-byebug the problem remains for me and thoughtbot/capybara-webkit#718 seems to still be an issue for me too.

@deivid-rodriguez
Copy link
Owner

@travisp I guess this is because pry-byebug is not using latest byebug's master. This should be fixed in next release.

@olivierlacan Sorry if my last sentence sounded rude, it's missing "could you".. :)

@deivid-rodriguez
Copy link
Owner

Closing for lack of feedback. Feel free to reopen if still happening.

@travisp travisp changed the title Threads run in the context of pry/byebug hang in 2.0.0 Threads run in the context of pry/byebug hang in >= 2.0.0 May 26, 2015
@travisp
Copy link
Author

travisp commented May 26, 2015

@deivid-rodriguez on pry-byebug 3.1.0 and byebug 4.0, as well as pry-byebug master this still remains an issue -- any threads run in this context seem to hang.

@justin808
Copy link

I just tried this and also ran into this issue. So still seems like an issue.

@deivid-rodriguez
Copy link
Owner

This seems like a duplicate of #69. Let's comment there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants