From ca92185630bdaf74a04047863eb32f18416c0a5d Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Tue, 1 Apr 2025 15:15:03 -0400 Subject: [PATCH] add metricsExport:true --- src/warnet/graph.py | 1 + test/graph_test.py | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/warnet/graph.py b/src/warnet/graph.py index d06387710..cff7caa15 100644 --- a/src/warnet/graph.py +++ b/src/warnet/graph.py @@ -85,6 +85,7 @@ def custom_graph( # Configure logging defaults_yaml_content["collectLogs"] = logging + defaults_yaml_content["metricsExport"] = logging with open(os.path.join(datadir, "node-defaults.yaml"), "w") as f: yaml.dump(defaults_yaml_content, f, default_flow_style=False, sort_keys=False) diff --git a/test/graph_test.py b/test/graph_test.py index 3d0ad5848..3ceb78bc2 100755 --- a/test/graph_test.py +++ b/test/graph_test.py @@ -37,20 +37,20 @@ def directory_exists(self): try: self.log.info("testing warnet create, dir does exist") self.sut = pexpect.spawn("warnet create") - self.sut.expect("name", timeout=10) + self.sut.expect("name", timeout=30) self.sut.sendline("ANewNetwork") - self.sut.expect("many", timeout=10) + self.sut.expect("many", timeout=30) self.sut.sendline("") - self.sut.expect("connections", timeout=10) + self.sut.expect("connections", timeout=30) self.sut.sendline("") - self.sut.expect("version", timeout=10) + self.sut.expect("version", timeout=30) self.sut.sendline("") - self.sut.expect("enable fork-observer", timeout=10) + self.sut.expect("enable fork-observer", timeout=30) self.sut.sendline("") - self.sut.expect("seconds", timeout=10) - self.sut.sendline("") - self.sut.expect("enable grafana", timeout=10) + self.sut.expect("seconds", timeout=30) self.sut.sendline("") + self.sut.expect("enable grafana", timeout=30) + self.sut.sendline("true") self.sut.expect("successfully", timeout=50) except Exception as e: print(f"\nReceived prompt text:\n {self.sut.before.decode('utf-8')}\n") @@ -74,6 +74,10 @@ def run_created_network(self): assert debugs["mempool"] # santy check assert not debugs["zmq"] + # verify that prometheus exporter is making its rpc calls + self.wait_for_predicate( + lambda: "method=getblockcount user=user" in self.warnet("logs tank-0000") + ) if __name__ == "__main__":