From a57b6e589ef0255578564c0004ce4f0d06c10e89 Mon Sep 17 00:00:00 2001 From: CookiePieWw Date: Thu, 16 Jan 2025 22:29:44 +0800 Subject: [PATCH] fix: fix unit test --- .../meta/src/wal_options_allocator/kafka_topic_pool.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/meta/src/wal_options_allocator/kafka_topic_pool.rs b/src/common/meta/src/wal_options_allocator/kafka_topic_pool.rs index a837adb50673..385b1f4c20ea 100644 --- a/src/common/meta/src/wal_options_allocator/kafka_topic_pool.rs +++ b/src/common/meta/src/wal_options_allocator/kafka_topic_pool.rs @@ -132,7 +132,11 @@ mod tests { ..Default::default() }; let kv_backend = Arc::new(MemoryKvBackend::new()) as KvBackendRef; - let topic_pool = KafkaTopicPool::new(config.clone(), kv_backend); + let mut topic_pool = KafkaTopicPool::new(config.clone(), kv_backend); + // Replaces the default topic pool with the constructed topics. + topic_pool.topics.clone_from(&topics); + // Replaces the default selector with a round-robin selector without shuffled. + topic_pool.selector = Arc::new(RoundRobinTopicSelector::default()); topic_pool.init().await.unwrap(); // Selects exactly the number of `num_topics` topics one by one.