feat: report daemon uptime in status
This commit is contained in:
parent
f91b9f54b3
commit
2d314e85bf
7 changed files with 50 additions and 8 deletions
|
|
@ -257,6 +257,7 @@ fn geth_status_against_running_daemon() {
|
|||
wait_for_socket(&home.path().join("run/geth.sock"));
|
||||
|
||||
let output = run_geth(home.path(), &["status"]);
|
||||
let json_output = run_geth(home.path(), &["--json", "status"]);
|
||||
let _ = daemon.kill();
|
||||
let _ = daemon.wait();
|
||||
|
||||
|
|
@ -268,6 +269,7 @@ fn geth_status_against_running_daemon() {
|
|||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
assert!(stdout.contains("geth daemon: running"));
|
||||
assert!(stdout.contains("agent:"));
|
||||
assert!(stdout.contains("uptime seconds:"));
|
||||
assert!(stdout.contains("store schema:"));
|
||||
assert!(stdout.contains("store journal: wal"));
|
||||
assert!(stdout.contains("store synchronous: normal"));
|
||||
|
|
@ -284,6 +286,25 @@ fn geth_status_against_running_daemon() {
|
|||
assert!(stdout.contains(
|
||||
"native backend pubsub: shared-iroh-endpoint-ready target iroh-gossip 0.101.0 (wired)"
|
||||
));
|
||||
|
||||
let status_json = command_json(&json_output);
|
||||
assert_eq!(status_json["type"], "status");
|
||||
assert!(
|
||||
status_json["daemon_started_at_ms"]
|
||||
.as_i64()
|
||||
.expect("daemon started at ms")
|
||||
> 0
|
||||
);
|
||||
assert!(
|
||||
status_json["daemon_uptime_seconds"]
|
||||
.as_u64()
|
||||
.expect("daemon uptime seconds")
|
||||
< 60
|
||||
);
|
||||
assert_eq!(status_json["store_journal_mode"], "wal");
|
||||
assert_eq!(status_json["store_synchronous"], "normal");
|
||||
assert_eq!(status_json["store_status"], "ok");
|
||||
assert!(status_json["native_backends"].is_array());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue