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

Function wait_for_down

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

Source from the content-addressed store, hash-verified

158
159
160def wait_for_down(cluster, node):
161 log.debug("Waiting for node %s to be down", node)
162 tries = 0
163 addr = IP_FORMAT % node
164 while tries < 100:
165 host = cluster.metadata.get_host(IP_FORMAT % node)
166 if not host or not host.is_up:
167 log.debug("Done waiting for node %s to be down", node)
168 return
169 else:
170 log.debug("Host is still marked up, waiting")
171 tries += 1
172 time.sleep(1)
173
174 raise RuntimeError("Host {0} is not down after {1} attempts".format(addr, tries))

Callers 5

_wait_for_nodes_downMethod · 0.90
_test_downgrading_clMethod · 0.90
rfthree_downgradingclMethod · 0.90

Calls 2

sleepMethod · 0.80
get_hostMethod · 0.45

Tested by 5

_wait_for_nodes_downMethod · 0.72
_test_downgrading_clMethod · 0.72
rfthree_downgradingclMethod · 0.72