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

FIX: Addressing typos and undefined references #615

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

patricknelson
Copy link

@patricknelson patricknelson commented Jul 20, 2019

Squishing two main bugs that appear to have arisen as regressions from #578:

  1. Use of screensize in a rescue block, resulting in an unrecoverable error when there's a read timeout (happens on my VM frequently on one particularly large page). 👞🐛
  2. Passing invalid_image_name (which is undefined) to the create_invalid_image() method. Fixed by reverting 👞🐞

Stack trace 1:

C:/Ruby24-x64/lib/ruby/2.4.0/net/http.rb:906:in `rescue in block in connect': Failed to open TCP connection to 127.0.0.1:9518 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 9518) (Errno::ECONNREFUSED)
        from C:/Ruby24-x64/lib/ruby/2.4.0/net/http.rb:903:in `block in connect'
        from C:/Ruby24-x64/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'
        from C:/Ruby24-x64/lib/ruby/2.4.0/timeout.rb:103:in `timeout'
        from C:/Ruby24-x64/lib/ruby/2.4.0/net/http.rb:902:in `connect'
        from C:/Ruby24-x64/lib/ruby/2.4.0/net/http.rb:1485:in `begin_transport'
        from C:/Ruby24-x64/lib/ruby/2.4.0/net/http.rb:1442:in `transport_request'
        from C:/Ruby24-x64/lib/ruby/2.4.0/net/http.rb:1416:in `request'
        from C:/Ruby24-x64/lib/ruby/2.4.0/net/http.rb:1165:in `get'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/service.rb:185:in `block in stop_server'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/service.rb:160:in `block in connect_to_server'
        from C:/Ruby24-x64/lib/ruby/2.4.0/net/http.rb:877:in `start'
        from C:/Ruby24-x64/lib/ruby/2.4.0/net/http.rb:608:in `start'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/service.rb:156:in `connect_to_server'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/service.rb:185:in `stop_server'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/service.rb:118:in `stop'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver/common/platform.rb:150:in `block in exit_hook'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/wraith-4.2.4/lib/wraith/save_images.rb:89:in `rescue in block in parallel_task': undefined local variable or method `invalid_image_name' for #<Wraith::SaveImages:0x0000000002d58548> (NameError)
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/wraith-4.2.4/lib/wraith/save_images.rb:80:in `block in parallel_task'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:506:in `call_with_index'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:360:in `block (2 levels) in work_in_threads'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:515:in `with_instrumentation'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:359:in `block in work_in_threads'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:209:in `block (3 levels) in in_threads'
Config validated. No serious issues found.
Creating Folders
SAVING IMAGES
ERROR: undefined local variable or method `screensize' for #<Wraith::SaveImages:0x0000000002d58548>
Did you mean?  screen_size
               screen_sizes
  URL = http://127.0.0.1/our-company/our-history/

Stack trace 2: From call to create_invalid_image

C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/wraith-4.2.4/lib/wraith/save_images.rb:89:in `rescue in block in parallel_task': undefined local variable or method `invalid_image_name' for #<Wraith::SaveImages:0x000000000359c470> (NameError)
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/wraith-4.2.4/lib/wraith/save_images.rb:80:in `block in parallel_task'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:506:in `call_with_index'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:360:in `block (2 levels) in work_in_threads'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:515:in `with_instrumentation'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:359:in `block in work_in_threads'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/parallel-1.17.0/lib/parallel.rb:209:in `block (3 levels) in in_threads'

…s stack trace on read timeout instead of continuing gracefully.
…gression caused by bbc#578) and just reverting to hard-coded 'invalid.jpg' from before.
@patricknelson patricknelson changed the title FIX: Addressing typo in screensize FIX: Addressing typos and undefined references Jul 20, 2019
@nicrodgers
Copy link

There's a typo in the patch - invalid.jg doesn't exist.

We have invalid1.jpg and invalid2.jpg so wraith fails with

No such file or directory @ rb_sysopen - /usr/local/bundle/gems/wraith-4.2.4/assets/invalid.jg (Errno::ENOENT)

…e (also typoed anyway). Instead extending existing pattern of differing failure images for various failure scenarios (blue).
@patricknelson
Copy link
Author

🤦‍♂ Ugh, my mistake. Sorry about that @nicrodgers. That is kind of funny, though.

Looking back, it also appears that the "Chromification" ticket #578 also deleted the invalid.jpg image in favor of two variants (invalid1.jpg and invalid2.jpg) in 5568005 for some reason (the other images came later). I think what I'll do for now is add another invalid3.jpg there for the other failure scenario, make it consistent with the other failure images but ensure it's a different color. Unfortunately it's not very accessible (not good for color blind folks using the app) and also the failure images aren't very descriptive, so hopefully someone could take that up in case they need more details since this functionality is too magical ✨

Anyway, thanks for letting me know. I've updated the PR!

@nicrodgers
Copy link

Nice one, thanks for sorting that so quickly!

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

Successfully merging this pull request may close these issues.

2 participants