Skip to content

Commit

Permalink
cluster/test: configure reserve_shard0 in fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
pgellert committed Dec 2, 2024
1 parent 398c983 commit cccb53d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/v/cluster/tests/partition_allocator_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

struct partition_allocator_fixture {
static constexpr uint32_t partitions_per_shard = 1000;
static constexpr uint32_t partitions_reserve_shard0 = 2;

partition_allocator_fixture()
: partition_allocator_fixture(std::nullopt, std::nullopt) {}
Expand Down Expand Up @@ -68,7 +67,7 @@ struct partition_allocator_fixture {
broker.id(),
broker.properties().cores,
config::mock_binding<uint32_t>(uint32_t{partitions_per_shard}),
config::mock_binding<uint32_t>(uint32_t{partitions_reserve_shard0}),
partitions_reserve_shard0.bind(),
kafka_internal_topics.bind()));
}

Expand Down Expand Up @@ -135,6 +134,7 @@ struct partition_allocator_fixture {
cluster::partition_allocator& allocator() { return _allocator.local(); }

config::mock_property<std::vector<ss::sstring>> kafka_internal_topics{{}};
config::mock_property<uint32_t> partitions_reserve_shard0{2};
model::topic_namespace tn{model::kafka_namespace, model::topic{"test"}};
ss::sharded<cluster::members_table> members;
ss::sharded<features::feature_table> features;
Expand All @@ -155,7 +155,7 @@ struct partition_allocator_fixture {
config::mock_binding<std::optional<size_t>>(memory_per_partition),
config::mock_binding<std::optional<int32_t>>(fds_per_partition),
config::mock_binding<uint32_t>(uint32_t{partitions_per_shard}),
config::mock_binding<uint32_t>(uint32_t{partitions_reserve_shard0}),
partitions_reserve_shard0.bind(),
kafka_internal_topics.bind(),
config::mock_binding<bool>(true))
.get();
Expand Down
2 changes: 1 addition & 1 deletion src/v/cluster/tests/partition_allocator_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ FIXTURE_TEST(updating_nodes_properties, partition_allocator_fixture) {
BOOST_REQUIRE_EQUAL(
it->second->max_capacity(),
10 * partition_allocator_fixture::partitions_per_shard
- partition_allocator_fixture::partitions_reserve_shard0);
- partitions_reserve_shard0());
}

FIXTURE_TEST(change_replication_factor, partition_allocator_fixture) {
Expand Down

0 comments on commit cccb53d

Please sign in to comment.