Watch
0
0
Fork
You've already forked hyperhive
0

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:
atlas 2026-11-27 13:38:56 +01:00 • committed by maia
commit 3f71739852

View file

@ -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):