Quantcast

Selenium crashes Chrome when running from Jenkins

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Selenium crashes Chrome when running from Jenkins

Liron Yahdav
TLDR: Running ruby scripts from Jenkins on OS X that use the selenium-webdriver gem with chromedriver causes the "Aw snap" page to come up in Chrome. Running those same scripts from outside of Jenkins works fine. Any ideas as to what's wrong?

------

Long version:
We have a CI machine that's a MacBook Pro running OS X Mountain Lion with Jenkins installed. The Jenkins server runs as a user who can login to the system. We configured Jasmine to use Chrome for the `rake jasmine:ci` command by setting ENV['JASMINE_BROWSER'] = 'chrome'. This all works fine when running `rake jasmine:ci` from the command line on that machine, but when Jenkins is configured to run the same exact command, Chrome will start up and when it tries to hit the url to run the tests, the tab crashes with the "Aw Snap" error page. I looked at the chromedriver.log file that's generated and there are no errors, it basically just stops all of a sudden. The Jenkins build eventually gets a Selenium timeout error.

I've tried setting up the same config on a MacBook Air running OS X Lion and the same problem occurs.
We also have integration tests written with RSpec and Capybara and when we configure it to use Selenium with chromedriver, the same problem occurs when running through Jenkins, though the "Aw Snap" page comes up a few steps into the first test.

Has anyone gotten a similar setup working or have any idea what the issue could be? Thanks!

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Selenium crashes Chrome when running from Jenkins

Sami Tikka
And how did you install Jenkins?

-- Sami

Liron Yahdav <[hidden email]> kirjoitti 6.8.2012 kello 20.31:

> TLDR: Running ruby scripts from Jenkins on OS X that use the selenium-webdriver gem with chromedriver causes the "Aw snap" page to come up in Chrome. Running those same scripts from outside of Jenkins works fine. Any ideas as to what's wrong?
>
> ------
>
> Long version:
> We have a CI machine that's a MacBook Pro running OS X Mountain Lion with Jenkins installed. The Jenkins server runs as a user who can login to the system. We configured Jasmine to use Chrome for the `rake jasmine:ci` command by setting ENV['JASMINE_BROWSER'] = 'chrome'. This all works fine when running `rake jasmine:ci` from the command line on that machine, but when Jenkins is configured to run the same exact command, Chrome will start up and when it tries to hit the url to run the tests, the tab crashes with the "Aw Snap" error page. I looked at the chromedriver.log file that's generated and there are no errors, it basically just stops all of a sudden. The Jenkins build eventually gets a Selenium timeout error.
> I've tried setting up the same config on a MacBook Air running OS X Lion and the same problem occurs.
> We also have integration tests written with RSpec and Capybara and when we configure it to use Selenium with chromedriver, the same problem occurs when running through Jenkins, though the "Aw Snap" page comes up a few steps into the first test.
>
> Has anyone gotten a similar setup working or have any idea what the issue could be? Thanks!
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Selenium crashes Chrome when running from Jenkins

Liron Yahdav
I installed it using the Mac OS X native package link from the http://jenkins-ci.org/ homepage.

On Tuesday, August 7, 2012 2:01:02 PM UTC-7, sti wrote:
And how did you install Jenkins?

-- Sami

Liron Yahdav <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="EIqUM3Lup8wJ">li...@...> kirjoitti 6.8.2012 kello 20.31:

> TLDR: Running ruby scripts from Jenkins on OS X that use the selenium-webdriver gem with chromedriver causes the "Aw snap" page to come up in Chrome. Running those same scripts from outside of Jenkins works fine. Any ideas as to what's wrong?
>
> ------
>
> Long version:
> We have a CI machine that's a MacBook Pro running OS X Mountain Lion with Jenkins installed. The Jenkins server runs as a user who can login to the system. We configured Jasmine to use Chrome for the `rake jasmine:ci` command by setting ENV['JASMINE_BROWSER'] = 'chrome'. This all works fine when running `rake jasmine:ci` from the command line on that machine, but when Jenkins is configured to run the same exact command, Chrome will start up and when it tries to hit the url to run the tests, the tab crashes with the "Aw Snap" error page. I looked at the chromedriver.log file that's generated and there are no errors, it basically just stops all of a sudden. The Jenkins build eventually gets a Selenium timeout error.
> I've tried setting up the same config on a MacBook Air running OS X Lion and the same problem occurs.
> We also have integration tests written with RSpec and Capybara and when we configure it to use Selenium with chromedriver, the same problem occurs when running through Jenkins, though the "Aw Snap" page comes up a few steps into the first test.
>
> Has anyone gotten a similar setup working or have any idea what the issue could be? Thanks!
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Selenium crashes Chrome when running from Jenkins

Sami Tikka
Unless you have changed the configuration by hand, the native OS X package sets up Jenkins as a launch daemon. Launch daemons have no access to window server, thus they are unable to display windows, like chrome. 

You must run Jenkins as a launch agent or use https://github.com/stisti/jenkins-app

-- Sami

Liron Yahdav <[hidden email]> kirjoitti 8.8.2012 kello 3.15:

I installed it using the Mac OS X native package link from the http://jenkins-ci.org/ homepage.

On Tuesday, August 7, 2012 2:01:02 PM UTC-7, sti wrote:
And how did you install Jenkins?

-- Sami

Liron Yahdav <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="EIqUM3Lup8wJ">li...@...> kirjoitti 6.8.2012 kello 20.31:

> TLDR: Running ruby scripts from Jenkins on OS X that use the selenium-webdriver gem with chromedriver causes the "Aw snap" page to come up in Chrome. Running those same scripts from outside of Jenkins works fine. Any ideas as to what's wrong?
>
> ------
>
> Long version:
> We have a CI machine that's a MacBook Pro running OS X Mountain Lion with Jenkins installed. The Jenkins server runs as a user who can login to the system. We configured Jasmine to use Chrome for the `rake jasmine:ci` command by setting ENV['JASMINE_BROWSER'] = 'chrome'. This all works fine when running `rake jasmine:ci` from the command line on that machine, but when Jenkins is configured to run the same exact command, Chrome will start up and when it tries to hit the url to run the tests, the tab crashes with the "Aw Snap" error page. I looked at the chromedriver.log file that's generated and there are no errors, it basically just stops all of a sudden. The Jenkins build eventually gets a Selenium timeout error.
> I've tried setting up the same config on a MacBook Air running OS X Lion and the same problem occurs.
> We also have integration tests written with RSpec and Capybara and when we configure it to use Selenium with chromedriver, the same problem occurs when running through Jenkins, though the "Aw Snap" page comes up a few steps into the first test.
>
> Has anyone gotten a similar setup working or have any idea what the issue could be? Thanks!
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Selenium crashes Chrome when running from Jenkins

Liron Yahdav
Thanks Sami, that fixed the issue! We configured Jenkins to run as a launch agent. It was just strange that when running as a launch daemon it would start up Chrome and I would see the window for Chrome, but it would go to the "aw, snap" error page in Chrome. I would think that if there were no access to the window server it wouldn't even display the window. I just don't know much about daemons and window servers on OS X. Anyway, thanks again.

Liron

On Thursday, August 9, 2012 9:56:49 PM UTC-7, sti wrote:
Unless you have changed the configuration by hand, the native OS X package sets up Jenkins as a launch daemon. Launch daemons have no access to window server, thus they are unable to display windows, like chrome. 

You must run Jenkins as a launch agent or use https://github.com/stisti/jenkins-app

-- Sami

Liron Yahdav <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="iDNm9ibtiKQJ">li...@...> kirjoitti 8.8.2012 kello 3.15:

I installed it using the Mac OS X native package link from the http://jenkins-ci.org/ homepage.

On Tuesday, August 7, 2012 2:01:02 PM UTC-7, sti wrote:
And how did you install Jenkins?

-- Sami

Liron Yahdav <[hidden email]> kirjoitti 6.8.2012 kello 20.31:

> TLDR: Running ruby scripts from Jenkins on OS X that use the selenium-webdriver gem with chromedriver causes the "Aw snap" page to come up in Chrome. Running those same scripts from outside of Jenkins works fine. Any ideas as to what's wrong?
>
> ------
>
> Long version:
> We have a CI machine that's a MacBook Pro running OS X Mountain Lion with Jenkins installed. The Jenkins server runs as a user who can login to the system. We configured Jasmine to use Chrome for the `rake jasmine:ci` command by setting ENV['JASMINE_BROWSER'] = 'chrome'. This all works fine when running `rake jasmine:ci` from the command line on that machine, but when Jenkins is configured to run the same exact command, Chrome will start up and when it tries to hit the url to run the tests, the tab crashes with the "Aw Snap" error page. I looked at the chromedriver.log file that's generated and there are no errors, it basically just stops all of a sudden. The Jenkins build eventually gets a Selenium timeout error.
> I've tried setting up the same config on a MacBook Air running OS X Lion and the same problem occurs.
> We also have integration tests written with RSpec and Capybara and when we configure it to use Selenium with chromedriver, the same problem occurs when running through Jenkins, though the "Aw Snap" page comes up a few steps into the first test.
>
> Has anyone gotten a similar setup working or have any idea what the issue could be? Thanks!
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Selenium crashes Chrome when running from Jenkins

Sami Tikka
I think the story goes there is a bug in OS X that allows some access to windowserver but not to all the services that would make a fully functional application. 

-- Sami

Liron Yahdav <[hidden email]> kirjoitti 20.8.2012 kello 21.30:

Thanks Sami, that fixed the issue! We configured Jenkins to run as a launch agent. It was just strange that when running as a launch daemon it would start up Chrome and I would see the window for Chrome, but it would go to the "aw, snap" error page in Chrome. I would think that if there were no access to the window server it wouldn't even display the window. I just don't know much about daemons and window servers on OS X. Anyway, thanks again.

Liron

On Thursday, August 9, 2012 9:56:49 PM UTC-7, sti wrote:
Unless you have changed the configuration by hand, the native OS X package sets up Jenkins as a launch daemon. Launch daemons have no access to window server, thus they are unable to display windows, like chrome. 

You must run Jenkins as a launch agent or use https://github.com/stisti/jenkins-app

-- Sami

Liron Yahdav <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="iDNm9ibtiKQJ">li...@...> kirjoitti 8.8.2012 kello 3.15:

I installed it using the Mac OS X native package link from the http://jenkins-ci.org/ homepage.

On Tuesday, August 7, 2012 2:01:02 PM UTC-7, sti wrote:
And how did you install Jenkins?

-- Sami

Liron Yahdav <[hidden email]> kirjoitti 6.8.2012 kello 20.31:

> TLDR: Running ruby scripts from Jenkins on OS X that use the selenium-webdriver gem with chromedriver causes the "Aw snap" page to come up in Chrome. Running those same scripts from outside of Jenkins works fine. Any ideas as to what's wrong?
>
> ------
>
> Long version:
> We have a CI machine that's a MacBook Pro running OS X Mountain Lion with Jenkins installed. The Jenkins server runs as a user who can login to the system. We configured Jasmine to use Chrome for the `rake jasmine:ci` command by setting ENV['JASMINE_BROWSER'] = 'chrome'. This all works fine when running `rake jasmine:ci` from the command line on that machine, but when Jenkins is configured to run the same exact command, Chrome will start up and when it tries to hit the url to run the tests, the tab crashes with the "Aw Snap" error page. I looked at the chromedriver.log file that's generated and there are no errors, it basically just stops all of a sudden. The Jenkins build eventually gets a Selenium timeout error.
> I've tried setting up the same config on a MacBook Air running OS X Lion and the same problem occurs.
> We also have integration tests written with RSpec and Capybara and when we configure it to use Selenium with chromedriver, the same problem occurs when running through Jenkins, though the "Aw Snap" page comes up a few steps into the first test.
>
> Has anyone gotten a similar setup working or have any idea what the issue could be? Thanks!
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Selenium crashes Chrome when running from Jenkins

emma
This post has NOT been accepted by the mailing list yet.
Hi Guys,

I think I have a similar problem - I have tried what you said and I'm not running Jenkins through a daemon but now launching the WAR.

I have the following problem though. When I run the script through command-line it works fine, but through Jenkins and it launches Firefox but doesn't run the tests and complains that it can't find the window. Please see my trace below:


Started by user anonymous
Building in workspace /Users/emma/.jenkins/jobs/test/workspace
Checkout:workspace / /Users/emma/.jenkins/jobs/test/workspace - hudson.remoting.LocalChannel@7d92ce93
Using strategy: Default
Last Built Revision: Revision 63b58def6508f3d5b9df81f6e0c701e6ce5fc299 (origin/HEAD, origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from /Users/emma/Sites/testGit/WatirMelonCucumber
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision 63b58def6508f3d5b9df81f6e0c701e6ce5fc299 (origin/HEAD, origin/master)
Checking out Revision 63b58def6508f3d5b9df81f6e0c701e6ce5fc299 (origin/HEAD, origin/master)
Warning : There are multiple branch changesets here
[workspace] $ /bin/sh -xe /var/folders/9p/v4wbyp551_91h2wnqz3t6tym0000gn/T/hudson932091185877954082.sh
+ ./go
Marked /Users/emma/.jenkins/jobs/test/workspace/.rvmrc as trusted
Using /Users/emma/.rvm/gems/ruby-1.9.2-p320 with gemset watirmelon-cucumber
Running /Users/emma/.rvm/hooks/after_use
Running /Users/emma/.rvm/hooks/after_cd
Successfully installed bundler-1.2.0
1 gem installed
Using rake (0.9.2.2)
Using bond (0.4.1)
Using builder (3.0.0)
Using ffi (1.0.11)
Using childprocess (0.3.1)
Using diff-lcs (1.1.3)
Using json (1.6.5)
Using gherkin (2.9.0)
Using term-ansicolor (1.0.7)
Using cucumber (1.1.9)
Using headless (0.2.2)
Using multi_json (1.0.4)
Using ripl (0.6.2)
Using rspec-core (2.8.0)
Using rspec-expectations (2.8.0)
Using rspec-mocks (2.8.0)
Using rspec (2.8.0)
Using rubyzip (0.9.6.1)
Using selenium-webdriver (2.19.0)
Using watir-webdriver (0.5.3)
Using watir-page-helper (1.0.0)
Using bundler (1.2.0)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Using the default profile...
unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError)
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/selenium-webdriver-2.19.0/lib/selenium/webdriver/firefox/launcher.rb:77:in `connect_until_stable'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/selenium-webdriver-2.19.0/lib/selenium/webdriver/firefox/launcher.rb:37:in `block in launch'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/selenium-webdriver-2.19.0/lib/selenium/webdriver/firefox/socket_lock.rb:20:in `locked'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/selenium-webdriver-2.19.0/lib/selenium/webdriver/firefox/launcher.rb:32:in `launch'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/selenium-webdriver-2.19.0/lib/selenium/webdriver/firefox/bridge.rb:19:in `initialize'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/selenium-webdriver-2.19.0/lib/selenium/webdriver/common/driver.rb:31:in `new'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/selenium-webdriver-2.19.0/lib/selenium/webdriver/common/driver.rb:31:in `for'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/selenium-webdriver-2.19.0/lib/selenium/webdriver.rb:61:in `for'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/watir-webdriver-0.5.3/lib/watir-webdriver/browser.rb:35:in `initialize'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/watir-page-helper-1.0.0/lib/watir-page-helper/commands.rb:22:in `new'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/watir-page-helper-1.0.0/lib/watir-page-helper/commands.rb:22:in `create'
/Users/emma/.jenkins/jobs/test/workspace/features/support/env.rb:9:in `<top (required)>'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:82:in `each'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/runtime.rb:175:in `load_step_definitions'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/runtime.rb:40:in `run!'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/cli/main.rb:43:in `execute!'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/lib/cucumber/cli/main.rb:20:in `execute'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/gems/cucumber-1.1.9/bin/cucumber:14:in `<top (required)>'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/bin/cucumber:19:in `load'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/bin/cucumber:19:in `<main>'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/bin/ruby_noexec_wrapper:14:in `eval'
/Users/emma/.rvm/gems/ruby-1.9.2-p320@watirmelon-cucumber/bin/ruby_noexec_wrapper:14:in `<main>'
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Loading...