aodn / python-aodndata

Handlers, destination path functions and any other code specific to a given facility or pipeline
GNU General Public License v3.0
0 stars 0 forks source link

Travis failing with URLError: Name or service not known #139

Closed mhidas closed 4 years ago

mhidas commented 5 years ago

See e.g. https://travis-ci.org/aodn/python-aodndata/jobs/542061243


======================================================================
ERROR: test_base (test_aodndata.soop.test_soop_asf_sst.TestSoopAsfSstHandler)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/aodncore/testlib/handlertest.py", line 26, in test_base
    handler = self.handler_class(self.temp_nc_file)
  File "/home/travis/build/aodn/python-aodndata/aodndata/soop/soop_asf_sst.py", line 14, in __init__
    self.ships = ship_callsign_list()
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/functools32/functools32.py", line 400, in wrapper
    result = user_function(*args, **kwds)
  File "/home/travis/build/aodn/python-aodndata/aodndata/soop/ship_callsign.py", line 27, in ship_callsign_list
    platform_codes = platform_altlabels_per_preflabel('Vessel')
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/aodncore/vocab/platform_code_vocab.py", line 70, in platform_altlabels_per_preflabel
    response = urlopen(platform_vocab_url)
  File "/opt/python/2.7.14/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/python/2.7.14/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/opt/python/2.7.14/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/opt/python/2.7.14/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/opt/python/2.7.14/lib/python2.7/urllib2.py", line 1228, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/opt/python/2.7.14/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno -2] Name or service not known>
mhidas commented 5 years ago

Aren't these mocked so that the unittests don't actually access any web services?

mhidas commented 5 years ago

@lwgordonimos @lbesnard Any thoughts on what happened here?

Seems to be an intermittent issue, as these tests have been passing on the last few runs.

ghost commented 5 years ago

Yeah this is more of a test design issue I think. It shouldn't be this complicated or unreliable to mock out real endpoints.

mhidas commented 4 years ago

I think this has been resolved.