Skip to content

Retry wget in the test suite when failing to resolve a host

An example when it fails:

spawn returned: [0, "", ""]
    And I save the state so the background can be restored next scenario # features/step_definitions/common_steps.rb:418
calling as amnesia: wget -O - 'http://example.com/'
call returned: [4, "", "--2015-07-09 13:24:20--  http://example.com/\nResolving example.com (example.com)... [Jul 09 13:24:21] ERROR torsocks[5911]: Unable to resolve. Status reply: 4 (in socks5_recv_resolve_reply() at socks5.c:657)\nfailed: Non-recoverable failure in name resolution.\nwget: unable to resolve host address `example.com'\n"]
Command failed: wget -O - 'http://example.com/'
error code: 4
stderr: --2015-07-09 13:24:20--  http://example.com/
Resolving example.com (example.com)... [Jul 09 13:24:21] ERROR torsocks[5911]: Unable to resolve. Status reply: 4 (in socks5_recv_resolve_reply() at socks5.c:657)
failed: Non-recoverable failure in name resolution.
wget: unable to resolve host address `example.com'
.
<false> is not true.

  Scenario: wget(1) should work for HTTP and go through Tor. # features/torified_misc.feature:15
    When I successfully wget "http://example.com/" to stdout # features/step_definitions/torified_misc.rb:32
      ExecutionFailedInVM (ExecutionFailedInVM)
      ./features/support/helpers/vm_helper.rb:382:in `rescue in execute_successfully'
      ./features/support/helpers/vm_helper.rb:378:in `execute_successfully'
      ./features/step_definitions/torified_misc.rb:36:in `/^I successfully wget "([^"]+)" to stdout(?:| with the '([^']+)' options)$/'
      features/torified_misc.feature:16:in `When I successfully wget "http://example.com/" to stdout'
    And the wget standard output contains "Example Domain"   # features/step_definitions/torified_misc.rb

Feature Branch: kytv:test/9715-wget

Parent Task: #9515 (closed)

Original created by @kytv on 9715 (Redmine)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information