aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver-test/hub-tests.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-03-20 13:44:00 +0100
committerGitHub Enterprise <[email protected]>2026-03-20 13:44:00 +0100
commit7cc4b1701aa2923573adabceed486229abba5a2d (patch)
tree04a1b5eddcabd24e5c5a50a817fa50c5829972f2 /src/zenserver-test/hub-tests.cpp
parentZs/consul token (#870) (diff)
downloadzen-7cc4b1701aa2923573adabceed486229abba5a2d.tar.xz
zen-7cc4b1701aa2923573adabceed486229abba5a2d.zip
add hub instance info (#869)
- Improvement: Hub module listing now includes per-instance process metrics (memory, CPU time, working set, pagefile usage) - Improvement: Hub now monitors provisioned instance health in the background and refreshes process metrics periodically - Improvement: Hub no longer exposes raw `StorageServerInstance` pointers to callers; instance state is returned as value snapshots (`Hub::InstanceInfo`) - Improvement: Hub instance access is now guarded by RAII per-instance locks (`SharedLockedPtr`/`ExclusiveLockedPtr`), preventing concurrent modifications during provisioning and deprovisioning - Improvement: Hub instance lifecycle is now tracked as a `HubInstanceState` enum covering transitional states (Provisioning, Deprovisioning, Hibernating, Waking); exposed as a string in the HTTP API and dashboard
Diffstat (limited to 'src/zenserver-test/hub-tests.cpp')
-rw-r--r--src/zenserver-test/hub-tests.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/zenserver-test/hub-tests.cpp b/src/zenserver-test/hub-tests.cpp
index 29c3b76ba..a372b11e5 100644
--- a/src/zenserver-test/hub-tests.cpp
+++ b/src/zenserver-test/hub-tests.cpp
@@ -44,7 +44,8 @@ TEST_CASE("hub.lifecycle.basic")
HttpClient Client(Instance.GetBaseUri() + "/hub/");
HttpClient::Response Result = Client.Get("status");
- CHECK(Result);
+ REQUIRE(Result);
+ CHECK_EQ(Result.AsObject()["modules"].AsArrayView().Num(), 0u);
}
}
@@ -71,6 +72,10 @@ TEST_CASE("hub.lifecycle.children")
const uint16_t AbcPort = AbcResult["port"].AsUInt16(0);
CHECK_NE(AbcPort, 0);
+ Result = Client.Get("modules/abc");
+ REQUIRE(Result);
+ CHECK_EQ(Result.AsObject()["state"].AsString(), "provisioned"sv);
+
// This should be a fresh instance with no contents
HttpClient AbcClient(fmt::format("http://localhost:{}", AbcPort));
@@ -231,9 +236,10 @@ TEST_CASE("hub.lifecycle.children")
Result = Client.Post("modules/def/deprovision");
REQUIRE(Result);
- // final sanity check that the hub is still responsive
+ // final sanity check that the hub is still responsive and all modules are gone
Result = Client.Get("status");
- CHECK(Result);
+ REQUIRE(Result);
+ CHECK_EQ(Result.AsObject()["modules"].AsArrayView().Num(), 0u);
}
}