mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-20 00:03:58 +00:00
Merge branch 'master' into 2916.grid-manager-integration-tests.2
This commit is contained in:
@ -657,19 +657,28 @@ def await_client_ready(tahoe, timeout=10, liveness=60*2, minimum_number_of_serve
|
||||
time.sleep(1)
|
||||
continue
|
||||
|
||||
print(
|
||||
f"Now: {time.ctime()}\n"
|
||||
f"Server last-received-data: {[s['last_received_data'] for s in servers]}"
|
||||
)
|
||||
|
||||
now = time.time()
|
||||
server_times = [
|
||||
server['last_received_data']
|
||||
for server in servers
|
||||
for server
|
||||
in servers
|
||||
if server['last_received_data'] is not None
|
||||
]
|
||||
print(
|
||||
f"Now: {time.ctime(now)}\n"
|
||||
f"Liveness required: {liveness}\n"
|
||||
f"Server last-received-data: {[time.ctime(s) for s in server_times]}\n"
|
||||
f"Server ages: {[now - s for s in server_times]}\n"
|
||||
)
|
||||
|
||||
# check that all times are 'recent enough' (it's OK if _some_ servers
|
||||
# are down, we just want to make sure a sufficient number are up)
|
||||
if len([time.time() - t <= liveness for t in server_times if t is not None]) < minimum_number_of_servers:
|
||||
print("waiting because at least one server too old")
|
||||
alive = [t for t in server_times if now - t <= liveness]
|
||||
if len(alive) < minimum_number_of_servers:
|
||||
print(
|
||||
f"waiting because we found {len(alive)} servers "
|
||||
f"and want {minimum_number_of_servers}"
|
||||
)
|
||||
time.sleep(1)
|
||||
continue
|
||||
|
||||
|
Reference in New Issue
Block a user