How do I make chromedriver suppress errors and warnings? - ruby

When using chromedriver 2.29 and watir-webdriver to drive a chrome browser on Windows 7 during automated tests or using IRB(interactive ruby shell) I constantly see errors and warnings written to standard output while the browser is in use.
Errors like this:
ERROR:gl_surface_egl.cc(690)] eglInitialize D3D11 failed with error EGL_NOT_INITIALIZED, trying next display type
This makes it difficult to use IRB because of the error text constantly getting in the way. It also makes test output in rspec really problematic and hard to read because of all the NOISY ERRORS/WARNINGS.
How can all these errors be silenced? I've tried to load up the browser with the --silent option that chromedriver has and this hasn't stopped the errors.

Updated to latest:
Chrome: Version 60.0.3112.78 (Official Build) (64-bit)
AND chromedriver: version 2.30
No longer seeing the issue.

Well if you want to ignore these errors you can use exceptions to ignore all the errors, you can read about how to do this here if you don't already know: https://www.tutorialspoint.com/ruby/ruby_exceptions.htm
If you want to keep the errors but make less clutter I would either write the errors to an error log file or write the text to an output log file.
Hope this helped!

Related

Why can't SnowSQL 1.2.2 find a version to download?

First thing I do after unpacking the SnowSQL Linux client is try to upgrade it. This has worked very well through at least v1.1.84. Today I downloaded v1.2.2, installed it, and got an error:
$ ~/bin/snowsql -Uv
No snowsql is available for download: url=https://sfc-repo.snowflakecomputing.com/snowsql, version=1.2
The error comes from this download. Has something changed? I get the same error even when I just try to use it with no options at all, or trying to connect by passing my account code and username.
The curl above was missing https and hence gave the wrong impression of 403 forbidden.
Some times due to a caching issue with the downloads it will not autoupgrade. There are two main components, one being bootstrap and the other one being the main snowsql component. The one you see the issue with is the main component (it is auto-downloaded when you run snowsql).
You can force new version download using snowsql -v 1.2.2 as an exmaple.
You can delete/move the .snowsql directory (~/.snowsql or ~/bin/.snowsql) to ensure a new main component version is downloaded by the new bootstrap.
You may also try using the newer versions for which the rpm is available at
https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/index.html
I noticed Snowflake has some weird firewall configs and similar errors can either happen consistently or intermittently.
The only option I'm aware of that can help if it happens consistently is to use --noup flag with your commands. This will not check for snowsql updates of course, but you can always manually download a newer version via your browser(with VPN is needed).

Is it possible to get Brunch to display more information on compile errors

Currently brunch.io running with watch just displays a very generic error message for me:
02 Dec 11:45:42 - error: Compiling of app/brunch/styles/public.scss failed.
I am trying to migrate over a bunch of legacy sass and Would love to know what/where it is breaking on, but I couldn't find anything to expand on this error message in the config documentation.
Anyone know a way to get brunch to display more detailed error messages?
This has been fixed in sass-brunch as of version 2.9.0
https://github.com/brunch/sass-brunch/issues/123#issuecomment-267175829

Highlight errors in Terminal

I had a problem with Terminal a Jekyll install but I didn't spot the site being not-uploaded to the server by rsync because I didn't see an error in the output. So, I was wandering:
Is there any way to make Terminal detect errors and give them a specific color?
My error here was:
rsync error: unexplained error (code 255) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [sender=2.6.9]
It had other things, but if this line was highlighted, I would have spotted it way earlier.
Generally speaking, color output is a responsibility of a program and not a terminal.
For example, clang compiler produces colorful error and warning messages.
If the application you are using does not support this, the only option is to create a wrapper and parse its output, highlighting errors in different color. This approach is taken by colorgcc, for instance, to make GCC compiler output in colors.
Perhaps you can grab that script and adjust it for your needs? Check it out here - https://github.com/colorgcc/colorgcc
Also, if there are errors, the app should probably exit with non-zero exit code. It might be a good idea to check it and write an even bigger and noticeable message upon exit in case of errors.
Hope it helps.
Good luck!
You can enable highlighting of errors for one command with the hilite utility. It only works for commands you type hilite for – it isn’t enabled globally – but it’s still useful if you know or suspect that a command outputs errors and you want to locate them. So when you build with jekyll, you could do any of the following:
Change jekyll … to hilite jekyll … in your build script
Try to remember to always type hilite before jekyll
Run jekyll normally, but if its output or exit code makes you suspect you got errors, run it again with hilite to locate them
On OS X, you can install hilite with Homebrew using brew install hilite.

How can I install Maglev with rvm on Mac OS X Lion?

I am trying to install Maglev on Mac OS X Lion with rvm, but running
rvm install maglev
as instructed on the github page only yields a 404 error:
curl: (22) The requested URL returned error: 404
ERROR: The requested url does not exist: 'http://glass-downloads.gemstone.com/maglev/MagLev-26852.Darwin-i386.tar.gz'
which does not seem too helpful, as it just points out that the respective file does not exist on the gemstone server. Google does not seem to know about this, so I thought about asking a question here. However, before doing so I tried some more and and got a little further running
rvm install maglev-head
as mentioned in some blog posts. This finally finds an appropriate file, downloads a bunch of things and starts to compile. It starts to look really well at a point where it says
Installing maglev to /[user-dir]/.rvm/rubies/maglev-head
in green, but unfortunately it does not get much further. The installation hangs after saying
Creating default 'maglev' repository.
Generating maglev HTML documentation
Generating smalltalk FFI.
or at least it takes forever (more than 30 minutes) without saying anything.
Stopping the installation at this point still looks promising giving me
$ rvm list
rvm rubies
maglev-head [ x86_64 ]
but unfortunately
rvm use maglev-head
results in
startstone[Info]: Starting Stone repository monitor 'maglev'.
startstone[Error]: Stone process (id=61119) has died.
startstone[Error]: Examine '/[user-dir]/.rvm/rubies/maglev-head/log/maglev/maglev.log' for more information. Excerpt follows:
without displaying an excerpt and even without stopping. Actually the log file does exist and has a few error messages, the most telling seems to be
GemStone is unable to open the file !TCP#localhost6#dbf!/[user-dir]/.rvm/rubies/maglev-head/data/maglev/extent/extent0.ruby.dbf
but the directory does exist, it would just be the file that is missing, and I would expect the server to create that one on an new image. Still, the situation does not look too bad as i get
which irb
giving me
/[user-dir]/.rvm/rubies/maglev-head/bin/irb
but when I try to start up irb I get
maglev-ruby: [Error] The MagLev server "maglev" is not running.
To fix this run "rake maglev:start" before running maglev-ruby.
but if I call the rake task as instructed I again get
maglev-ruby: [Error] The MagLev server "maglev" is not running.
To fix this run "rake maglev:start" before running maglev-ruby.
putting me in a recursive causality loop. Trying to start the maglev server by hand using
maglev start
as I did on a previous installation using the shell scripts does not work either, giving me
startstone[Info]: Starting Stone repository monitor 'maglev'.
startstone[Error]: Stone process (id=61400) has died.
startstone[Error]: Examine '/[user-dir]/.rvm/rubies/maglev-head/log/maglev/maglev.log' for more information. Excerpt follows:
again without displaying an excerpt and hanging.
Any help would be appreciated as Maglev looks like a really promising piece of infrastructure.
You need to do "rvm get head" first; I can see it was looking for MagLev-26852.Darwin-i386.tar.gz, which was for an older version both of MagLev and of RVM.
I'd do an "rvm remove maglev; rvm install maglev" It shouldn't take more than a few minutes then to build once it's downloaded.

Ruby eventmachine error: 'no loop breaker'

I get a slightly heisen error from eventmachine (0.12.10, on OSX 10.6.4):
terminate called after throwing an instance of 'std::runtime_error'
what(): no loop breaker
It only occurs in tests, and only when all tests are run together. Run individually they pass.
I spotted the only place in the eventmachine code that mentions the error's message:
http://github.com/eventmachine/eventmachine/blob/master/ext/em.cpp#L333
(What puzzles me as well is that it looks like a win32 code path, or am I wrong?)
To me it looks like some ressource like sockets are used up. That would explain the occurence pattern.
Ok, I found it myself.
The error comes in fact from the win32 conditionally compiled code. I get a plain old "Too many open files" error if I build locally, and that problem is easy to releave by increasing the ulimit value for open files (which is said to be quite modest by default on OSX).
ulimit -n 1024 # or whichever value you find appropriate
(Default is 255, look at the output of ulimit -a)
If I build and install from the cloned git repository using rake gem:install, I get the expected (Unix) error message. So the bug appears to be fixed in master.
Filed bug for the rubygems.org gem is here: http://github.com/eventmachine/eventmachine/issues#issue/88

Resources