Giter Site home page Giter Site logo

Comments (11)

denofevil avatar denofevil commented on August 10, 2024 3

This seems to be caused by introduction of 60s @open_timeout in http.rb. It used to be nil, so no additional threads were spawned. Now, with 60s it spawns a new thread, which cannot run as the process is stopped on the breakpoint, so it timeouts there.

Minimal case would look like this:

require 'timeout'

def compute_with_timeout
  Timeout.timeout(10) { Thread.list }
end
with = compute_with_timeout #breakpoint here
puts with

from ruby-debug-ide.

stevegibson avatar stevegibson commented on August 10, 2024

Per this stackoverflow question, this is also happening with Watir-webdriver.

from ruby-debug-ide.

luke-hill avatar luke-hill commented on August 10, 2024

Sorry to bump a really old thread. Did this get anywhere?

from ruby-debug-ide.

xenjke avatar xenjke commented on August 10, 2024
class OverrideDriver < Selenium::WebDriver::Remote::Http::Default
  def http
    client = super
    client.open_timeout = 0
    client
  end
end

# when creating driver instance
Watir.new(:chrome, http_client: OverrideDriver.new)

that solves the issue for me

from ruby-debug-ide.

luke-hill avatar luke-hill commented on August 10, 2024

@xenjke Are you using Se3+?

from ruby-debug-ide.

xenjke avatar xenjke commented on August 10, 2024

@luke-hill 3.4.0 it is

from ruby-debug-ide.

xenjke avatar xenjke commented on August 10, 2024

@luke-hill another workaround mentioned in https://youtrack.jetbrains.com/issue/RUBY-17930#comment=27-1794364 is to monkeypatch the Timeout module for debugging purposes only.

Do not use that on production.

module Timeout
  def timeout(sec, klass=nil)
    yield(sec)
  end
  module_function :timeout
end

from ruby-debug-ide.

xenjke avatar xenjke commented on August 10, 2024

came up with

if $LOADED_FEATURES.any? { |f| f.include? 'debase' }
  module Timeout
    def timeout(sec, klass=nil)
      yield(sec)
    end

    module_function :timeout
  end
end

from ruby-debug-ide.

luke-hill avatar luke-hill commented on August 10, 2024

@xenjke The original one works when I implement it as written (I tried a slightly shorter version).

I'd rather know why this has happened. I had a look at the docs and I have traced the file in RubyMine, but as I'm using Se2.53 I'm not sure why this is happening.

Either way your fix works, I just hope RubyMine fix it up their end if possible

from ruby-debug-ide.

luke-hill avatar luke-hill commented on August 10, 2024

This issue can be closed as fixed.

For readers: Use at least RubyMine 2017.2.x+ and either
Ruby 2.2
or
Ruby 2.3+ and Selenium 3.0.7+

from ruby-debug-ide.

valich avatar valich commented on August 10, 2024

@luke-hill There is still an issue with incorrect thread usage for timeout, #128 should make ruby use another thread for evaluation. It's targeted to 2018.1

from ruby-debug-ide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.