Skip to content

Regression

OmeroPy.test.integration.gatewaytest.test_wrapper.TestWrapper.testAllObjectsWrapped (from pytest)

Failing for the past 1 build (Since #175 )
Took 1.3 sec.

Error Message

failed on setup with "urllib.error.URLError: <urlopen error [Errno 111] Connection refused>"

Stacktrace

self = <urllib.request.HTTPSHandler object at 0x7fda84edb490>
http_class = <class 'http.client.HTTPSConnection'>
req = <urllib.request.Request object at 0x7fda2f4e81c0>
http_conn_args = {'check_hostname': None, 'context': None}
host = 'downloads.openmicroscopy.org'
h = <http.client.HTTPSConnection object at 0x7fda2f4e8a30>

    def do_open(self, http_class, req, **http_conn_args):
        """Return an HTTPResponse object for the request, using http_class.
    
        http_class must implement the HTTPConnection API from http.client.
        """
        host = req.host
        if not host:
            raise URLError('no host given')
    
        # will parse host:port
        h = http_class(host, timeout=req.timeout, **http_conn_args)
        h.set_debuglevel(self._debuglevel)
    
        headers = dict(req.unredirected_hdrs)
        headers.update({k: v for k, v in req.headers.items()
                        if k not in headers})
    
        # TODO(jhylton): Should this be redesigned to handle
        # persistent connections?
    
        # We want to make an HTTP/1.1 request, but the addinfourl
        # class isn't prepared to deal with a persistent connection.
        # It will try to read all remaining data from the socket,
        # which will block while the server waits for the next request.
        # So make sure the connection gets closed after the (only)
        # request.
        headers["Connection"] = "close"
        headers = {name.title(): val for name, val in headers.items()}
    
        if req._tunnel_host:
            tunnel_headers = {}
            proxy_auth_hdr = "Proxy-Authorization"
            if proxy_auth_hdr in headers:
                tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
                # Proxy-Authorization should not be sent to origin
                # server.
                del headers[proxy_auth_hdr]
            h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
    
        try:
            try:
>               h.request(req.get_method(), req.selector, req.data, headers,
                          encode_chunked=req.has_header('Transfer-encoding'))

/usr/lib64/python3.9/urllib/request.py:1346: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.9/http/client.py:1285: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/lib64/python3.9/http/client.py:1331: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib64/python3.9/http/client.py:1280: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib64/python3.9/http/client.py:1040: in _send_output
    self.send(msg)
/usr/lib64/python3.9/http/client.py:980: in send
    self.connect()
/usr/lib64/python3.9/http/client.py:1447: in connect
    super().connect()
/usr/lib64/python3.9/http/client.py:946: in connect
    self.sock = self._create_connection(
/usr/lib64/python3.9/socket.py:844: in create_connection
    raise err
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

address = ('downloads.openmicroscopy.org', 443)
timeout = <object object at 0x7fdb17c7cb40>, source_address = None

    def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
                          source_address=None):
        """Connect to *address* and return the socket object.
    
        Convenience function.  Connect to *address* (a 2-tuple ``(host,
        port)``) and return the socket object.  Passing the optional
        *timeout* parameter will set the timeout on the socket instance
        before attempting to connect.  If no *timeout* is supplied, the
        global default timeout setting returned by :func:`getdefaulttimeout`
        is used.  If *source_address* is set it must be a tuple of (host, port)
        for the socket to bind as a source address before making the connection.
        A host of '' or port 0 tells the OS to use the default.
        """
    
        host, port = address
        err = None
        for res in getaddrinfo(host, port, 0, SOCK_STREAM):
            af, socktype, proto, canonname, sa = res
            sock = None
            try:
                sock = socket(af, socktype, proto)
                if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
                    sock.settimeout(timeout)
                if source_address:
                    sock.bind(source_address)
>               sock.connect(sa)
E               ConnectionRefusedError: [Errno 111] Connection refused

/usr/lib64/python3.9/socket.py:832: ConnectionRefusedError

During handling of the above exception, another exception occurred:

request = <SubRequest 'author_testimg' for <Function testAllObjectsWrapped>>
gatewaywrapper = <omero.gateway.pytest_fixtures.GatewayWrapper object at 0x7fda8451d7f0>

    @pytest.fixture(scope='function')
    def author_testimg(request, gatewaywrapper):
        """
        logs in as Author and returns the test image, creating it first if needed.
        """
        gatewaywrapper.loginAsAuthor()
>       rv = gatewaywrapper.getTestImage(autocreate=True)

../../../../.venv3/lib64/python3.9/site-packages/omero/gateway/pytest_fixtures.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../../.venv3/lib64/python3.9/site-packages/omero/gateway/scripts/testdb_create.py:150: in getTestImage
    return dbhelpers.getImage(self.gateway, 'testimg1', forceds=dataset,
../../../../.venv3/lib64/python3.9/site-packages/omero/gateway/scripts/dbhelpers.py:501: in getImage
    i = IMAGES[alias].create()
../../../../.venv3/lib64/python3.9/site-packages/omero/gateway/scripts/dbhelpers.py:419: in create
    fin = urllib.request.urlopen(TESTIMG_URL + self.filename)
/usr/lib64/python3.9/urllib/request.py:214: in urlopen
    return opener.open(url, data, timeout)
/usr/lib64/python3.9/urllib/request.py:517: in open
    response = self._open(req, data)
/usr/lib64/python3.9/urllib/request.py:534: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib64/python3.9/urllib/request.py:494: in _call_chain
    result = func(*args)
/usr/lib64/python3.9/urllib/request.py:1389: in https_open
    return self.do_open(http.client.HTTPSConnection, req,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <urllib.request.HTTPSHandler object at 0x7fda84edb490>
http_class = <class 'http.client.HTTPSConnection'>
req = <urllib.request.Request object at 0x7fda2f4e81c0>
http_conn_args = {'check_hostname': None, 'context': None}
host = 'downloads.openmicroscopy.org'
h = <http.client.HTTPSConnection object at 0x7fda2f4e8a30>

    def do_open(self, http_class, req, **http_conn_args):
        """Return an HTTPResponse object for the request, using http_class.
    
        http_class must implement the HTTPConnection API from http.client.
        """
        host = req.host
        if not host:
            raise URLError('no host given')
    
        # will parse host:port
        h = http_class(host, timeout=req.timeout, **http_conn_args)
        h.set_debuglevel(self._debuglevel)
    
        headers = dict(req.unredirected_hdrs)
        headers.update({k: v for k, v in req.headers.items()
                        if k not in headers})
    
        # TODO(jhylton): Should this be redesigned to handle
        # persistent connections?
    
        # We want to make an HTTP/1.1 request, but the addinfourl
        # class isn't prepared to deal with a persistent connection.
        # It will try to read all remaining data from the socket,
        # which will block while the server waits for the next request.
        # So make sure the connection gets closed after the (only)
        # request.
        headers["Connection"] = "close"
        headers = {name.title(): val for name, val in headers.items()}
    
        if req._tunnel_host:
            tunnel_headers = {}
            proxy_auth_hdr = "Proxy-Authorization"
            if proxy_auth_hdr in headers:
                tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
                # Proxy-Authorization should not be sent to origin
                # server.
                del headers[proxy_auth_hdr]
            h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
    
        try:
            try:
                h.request(req.get_method(), req.selector, req.data, headers,
                          encode_chunked=req.has_header('Transfer-encoding'))
            except OSError as err: # timeout error
>               raise URLError(err)
E               urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

/usr/lib64/python3.9/urllib/request.py:1349: URLError