Giter Club home page Giter Club logo

Comments (5)

zpetukhov avatar zpetukhov commented on May 24, 2024 1

@leonid-shevtsov @Lordnibbler
I can confirm that there is issue to run scripts which uses selenium+headless concurrently.
I've writed small script which reproduces that kind of error:
http://pastebin.com/96h2WEuf
To reproduce error:
run the script in two different consoles, first with command line parameter "10" (without quotes), second with command line parameter "1". Then see what's happening after second script finish.

Looks like using different display numbers solves this issue.
But I think in that case it's better to run Xvfb one time before starting ruby scripts, there is no need to start/stop Xvfb which is performed when you executing headless.start / headless.destroy (destroy also occurs on_exit automatically)

from headless.

leonid-shevtsov avatar leonid-shevtsov commented on May 24, 2024

Does using Headless.new(autopick: true) in the sidekick worker solve your problem? That should choose the first available display number.

(BTW, the error is from Selenium, not Xvfb, and it means that Selenium failed to boot - this might be caused by missing Xvfb, but other things too - like a Selenium port conflict.)

from headless.

Lordnibbler avatar Lordnibbler commented on May 24, 2024

@leonid-shevtsov isn't autopick: true the default?

It would seem that passing display: key will conflict with the autopick settings.

I do have Xvfb installed, and do not have this error when running a single thread, only when I introduce concurrent workers.

from headless.

leonid-shevtsov avatar leonid-shevtsov commented on May 24, 2024

How do you start your Selenium? Do you specify different ports for each Selenium instance?

from headless.

Lordnibbler avatar Lordnibbler commented on May 24, 2024

@leonid-shevtsov simply like this:

def driver
  @driver ||= Selenium::WebDriver.for :firefox
end

should I be specifying a unique port each time if I am running on concurrent workers?

from headless.

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.