MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / wait_for_up

Function wait_for_up

tests/integration/long/utils.py:142–157  ·  view source on GitHub ↗
(cluster, node)

Source from the content-addressed store, hash-verified

140
141
142def wait_for_up(cluster, node):
143 tries = 0
144 addr = IP_FORMAT % node
145 while tries < 100:
146 host = cluster.metadata.get_host(addr)
147 if host and host.is_up:
148 wait_for_node_socket(get_node(node), 60)
149 log.debug("Done waiting for node %s to be up", node)
150 return
151 else:
152 log.debug("Host {} is still marked down, waiting".format(addr))
153 tries += 1
154 time.sleep(1)
155
156 # todo: don't mix string interpolation methods in the same package
157 raise RuntimeError("Host {0} is not up after {1} attempts".format(addr, tries))
158
159
160def wait_for_down(cluster, node):

Calls 4

wait_for_node_socketFunction · 0.90
get_nodeFunction · 0.90
sleepMethod · 0.80
get_hostMethod · 0.45