Copilot commented on code in PR #13368:
URL: https://github.com/apache/gluten/pull/13368#discussion_r4387895264


##########
cpp/velox/tests/VeloxBackendTest.cc:
##########
@@ -18,31 +18,60 @@
 #include <folly/executors/CPUThreadPoolExecutor.h>
 #include <folly/futures/Future.h>
 #include <gtest/gtest.h>
+#include <optional>
+#include <string>
 #include <thread>
+#include <unordered_map>
 
 #include "compute/VeloxBackend.h"
 #include "config/VeloxConfig.h"
 
 namespace gluten {
 
-class VeloxBackendTest : public ::testing::Test {
+struct BroadcastBuildThreadsTestParam {
+  int taskSlots;
+  std::optional<int> buildThreads;
+  std::optional<int> expectedThreads;
+};
+
+class VeloxBackendTest : public 
::testing::TestWithParam<BroadcastBuildThreadsTestParam> {
  protected:
-  static void SetUpTestSuite() {
-    VeloxBackend::create(AllocationListener::noop(), 
{{kNumTaskSlotsPerExecutor, "0"}});
+  void SetUp() override {
+    const auto& param = GetParam();
+    std::unordered_map<std::string, std::string> 
conf{{kNumTaskSlotsPerExecutor, std::to_string(param.taskSlots)}};
+    if (param.buildThreads.has_value()) {
+      conf.emplace(kBroadcastHashTableBuildThreads, 
std::to_string(param.buildThreads.value()));
+    }
+    VeloxBackend::create(AllocationListener::noop(), conf);

Review Comment:
   Running `velox_backend_test` without a filter, or with multiple parameter 
cases selected, now initializes the backend repeatedly in one process, so 
subsequent cases cannot initialize successfully. `VeloxBackend::init()` 
registers process-global factories that reject duplicate registrations, and 
`tearDown()` does not unregister them. Isolate each configuration in a fresh 
subprocess or extract the pool-construction logic so these cases can test 
sizing without reinitializing the backend.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to