semi-spread: show the controller pod's log where the test printed the empty journal
The swarm-controller runs as a pod, so journalctl -u swarm-controller on the swarm machine has no entries. When create_agent gives up, and when the agents do not settle, the test now prints the pod's log, and counts the deploy requests in it instead of in the journal.
This commit is contained in:
parent
51ae57fb02
commit
a44b6518a4
1 changed files with 13 additions and 4 deletions
|
|
@ -230,6 +230,13 @@ let
|
|||
print(f"--- {m.name}: {command}")
|
||||
print(m.execute(command)[1])
|
||||
|
||||
def print_controller_log():
|
||||
# The controller runs as a pod: its log is the cluster's, not a journal of the swarm machine.
|
||||
log = swarm.execute("kubectl -n hyperhive logs deploy/swarm-controller --tail=300")[1]
|
||||
print("--- swarm: the swarm-controller pod's log")
|
||||
print(log)
|
||||
return log
|
||||
|
||||
HIVE_UNITS = ["hive-priv.socket", "hive-priv.service", "hive-c0re"]
|
||||
|
||||
def hive_fault():
|
||||
|
|
@ -312,11 +319,12 @@ let
|
|||
time.sleep(10)
|
||||
diagnose_queue()
|
||||
diagnose(hive, HIVE_UNITS)
|
||||
diagnose(swarm, ["swarm-controller"])
|
||||
diagnose(swarm)
|
||||
log = print_controller_log()
|
||||
diagnose(heavyduty, "swarm-builder", "swarm-builder")
|
||||
if not fault:
|
||||
deploys = sum("swarm jobq: deploy requested" in m for _, _, m in controller_events(since))
|
||||
fault = f"the agents did not settle within {timeout}s; the controller sent {deploys} deploy request(s) since the creates"
|
||||
deploys = log.count("swarm jobq: deploy requested")
|
||||
fault = f"the agents did not settle within {timeout}s; the controller's log holds {deploys} deploy request line(s)"
|
||||
raise Exception(fault)
|
||||
|
||||
def store_sealed(timeout):
|
||||
|
|
@ -348,7 +356,8 @@ let
|
|||
if out.strip().startswith("2"):
|
||||
return
|
||||
swarm.sleep(10)
|
||||
diagnose(swarm, "swarm-controller")
|
||||
diagnose(swarm)
|
||||
print_controller_log()
|
||||
raise Exception(f"the controller refused to create {body['name']}: HTTP {out}: {swarm.succeed('cat /root/create.out')}")
|
||||
|
||||
def http(m, name, path="/", resolve=None):
|
||||
|
|
|
|||
Loading…
Reference in a new issue