CohenLabPrinceton / pvp

Raspberry pi code for controlling the rapid-deploy critical care ventilator
GNU General Public License v3.0
13 stars 15 forks source link

Remote Coordinator test fails intermittently on Travis CI #67

Closed CommReteris closed 4 years ago

CommReteris commented 4 years ago
=================================== FAILURES ===================================
_____________________________ test_remote_sensors ______________________________
    @pytest.mark.timeout(10)
    def test_remote_sensors():
        # wait before
        #while not is_port_in_use(rpc.default_port):
        #    time.sleep(1)
        coordinator = get_coordinator(single_process=False, sim_mode=True)
        # TODO need to wait for rpc client start?
        #time.sleep(1)
>       coordinator.start()
tests/test_coordinator.py:181: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
vent/coordinator/coordinator.py:151: in start
    self.rpc_client.start()
/opt/python/3.7.1/lib/python3.7/xmlrpc/client.py:1112: in __call__
    return self.__send(self.__name, args)
/opt/python/3.7.1/lib/python3.7/xmlrpc/client.py:1452: in __request
    verbose=self.__verbose
/opt/python/3.7.1/lib/python3.7/xmlrpc/client.py:1154: in request
    return self.single_request(host, handler, request_body, verbose)
/opt/python/3.7.1/lib/python3.7/xmlrpc/client.py:1166: in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
/opt/python/3.7.1/lib/python3.7/xmlrpc/client.py:1279: in send_request
    self.send_content(connection, request_body)
/opt/python/3.7.1/lib/python3.7/xmlrpc/client.py:1309: in send_content
    connection.endheaders(request_body)
/opt/python/3.7.1/lib/python3.7/http/client.py:1224: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/opt/python/3.7.1/lib/python3.7/http/client.py:1016: in _send_output
    self.send(msg)
/opt/python/3.7.1/lib/python3.7/http/client.py:956: in send
    self.connect()
/opt/python/3.7.1/lib/python3.7/http/client.py:928: in connect
    (self.host,self.port), self.timeout, self.source_address)
/opt/python/3.7.1/lib/python3.7/socket.py:727: in create_connection
    raise err
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
address = ('localhost', 9533), timeout = <object object at 0x7f042e6663c0>
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
/opt/python/3.7.1/lib/python3.7/socket.py:716: ConnectionRefusedError