diff --git a/nix/vm-tests/semi-spread.nix b/nix/vm-tests/semi-spread.nix index 43ec028b1..28c512102 100644 --- a/nix/vm-tests/semi-spread.nix +++ b/nix/vm-tests/semi-spread.nix @@ -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):