aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/storageserver
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@vespa.ai>2024-06-21 14:29:23 +0000
committerTor Brede Vekterli <vekterli@vespa.ai>2024-06-21 14:29:23 +0000
commit29d2b66be460ed473b57c45eda868a73bce456d1 (patch)
tree72c022675e06e56272902f93912f279d06f89080 /storage/src/tests/storageserver
parent85657039013efab50ad7c946ffb1ee4573a8bf36 (diff)
Support decoding distribution config as part of cluster state bundles in C++
Actually _encoding_ config in the same format as that used for decoding config payloads is not directly supported, so we do our own roundabout conversion as part of testing.
Diffstat (limited to 'storage/src/tests/storageserver')
-rw-r--r--storage/src/tests/storageserver/rpc/cluster_controller_rpc_api_service_test.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/storage/src/tests/storageserver/rpc/cluster_controller_rpc_api_service_test.cpp b/storage/src/tests/storageserver/rpc/cluster_controller_rpc_api_service_test.cpp
index c3641b9bc56..e59f6d22080 100644
--- a/storage/src/tests/storageserver/rpc/cluster_controller_rpc_api_service_test.cpp
+++ b/storage/src/tests/storageserver/rpc/cluster_controller_rpc_api_service_test.cpp
@@ -121,7 +121,7 @@ struct SetStateFixture : FixtureBase {
}
static lib::ClusterStateBundle dummy_baseline_bundle_with_deferred_activation(bool deferred) {
- return lib::ClusterStateBundle(lib::ClusterState("version:123 distributor:3 storage:3"), {}, deferred);
+ return {lib::ClusterState("version:123 distributor:3 storage:3"), {}, deferred};
}
};
@@ -166,6 +166,16 @@ TEST_F(ClusterControllerApiRpcServiceTest, set_distribution_states_rpc_with_feed
f.assert_request_received_and_propagated(bundle);
}
+TEST_F(ClusterControllerApiRpcServiceTest, can_receive_cluster_state_bundle_with_embedded_distribution_config) {
+ auto distr_cfg = lib::DistributionConfigBundle::of(lib::Distribution::getDefaultDistributionConfig(3, 14));
+ SetStateFixture f;
+ lib::ClusterStateBundle bundle(
+ std::make_shared<const lib::ClusterState>("version:123 distributor:3 storage:3"),
+ {}, std::nullopt, std::move(distr_cfg), false);
+
+ f.assert_request_received_and_propagated(bundle);
+}
+
TEST_F(ClusterControllerApiRpcServiceTest, compressed_bundle_is_transparently_uncompressed) {
SetStateFixture f;
auto state_str = make_compressable_state_string();