test/functional/test_framework/test_node.py
def wait_for_rpc_connection(self):
        """Sets up an RPC connection to the wificoind process. Returns False if unable to connect."""
        # Poll at a rate of four times per second
        poll_per_s = 4
        for _ in range(poll_per_s * self.rpc_timeout):
            assert self.process.poll() is None, "wificoind exited with status %i during initialization" % self.process.returncode
            try:
                self.rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir)
                self.rpc.getblockcount()
                # If the call to getblockcount() succeeds then the RPC connection is up
                self.rpc_connected = True
                self.url = self.rpc.url
                self.log.debug("RPC successfully started")
                return
            except IOError as e:
                if e.errno != errno.ECONNREFUSED:  # Port not yet open?
                    raise  # unknown IO error
            except JSONRPCException as e:  # Initialization phase
                if e.error['code'] != -28:  # RPC in warmup?
                    raise  # unknown JSON RPC exception
            except ValueError as e:  # cookie file not found and no rpcuser or rpcassword. wificoind still starting
                if "No RPC credentials" not in str(e):
                    raise
            time.sleep(1.0 / poll_per_s)
        raise AssertionError("Unable to connect to wificoind")
Sets up an RPC connection to the wificoind process. Returns False if unable to connect.
Sets up an RPC connection to the wificoind process. Returns False if unable to connect.
Sets up an RPC connection to the wificoind process . Returns False if unable to connect .
def wait_for_rpc_connection(self):
        poll_per_s = 4
        for _ in range(poll_per_s * self.rpc_timeout):
            assert self.process.poll() is None, "wificoind exited with status %i during initialization" % self.process.returncode
            try:
                self.rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir)
                self.rpc.getblockcount()
                self.rpc_connected = True
                self.url = self.rpc.url
                self.log.debug("RPC successfully started")
                return
            except IOError as e:
                if e.errno != errno.ECONNREFUSED:  
                    raise  
            except JSONRPCException as e:  
                if e.error['code'] != -28:  
                    raise  
            except ValueError as e:  
                if "No RPC credentials" not in str(e):
                    raise
            time.sleep(1.0 / poll_per_s)
        raise AssertionError("Unable to connect to wificoind")
def wait_for_rpc_connection ( self ) : poll_per_s = 4 for _ in range ( poll_per_s * self . rpc_timeout ) : assert self . process . poll ( ) is None , "wificoind exited with status %i during initialization" % self . process . returncode try : self . rpc = get_rpc_proxy ( rpc_url ( self . datadir , self . index , self . rpchost ) , self . index , timeout = self . rpc_timeout , coveragedir = self . coverage_dir ) self . rpc . getblockcount ( ) self . rpc_connected = True self . url = self . rpc . url self . log . debug ( "RPC successfully started" ) return except IOError as e : if e . errno != errno . ECONNREFUSED : raise except JSONRPCException as e : if e . error [ 'code' ] != - 28 : raise except ValueError as e : if "No RPC credentials" not in str ( e ) : raise time . sleep ( 1.0 / poll_per_s ) raise AssertionError ( "Unable to connect to wificoind" )
Sets up an RPC connection to the wificoind process.
Sets up an RPC connection to the wificoind process .
"""Sets up an RPC connection to the wificoind process. Returns False if unable to connect.""" # Poll at a rate of four times per second # If the call to getblockcount() succeeds then the RPC connection is up # Port not yet open? # unknown IO error # Initialization phase # RPC in warmup? # unknown JSON RPC exception # cookie file not found and no rpcuser or rpcassword. wificoind still starting
self