pitrou commented on a change in pull request #11888:
URL: https://github.com/apache/arrow/pull/11888#discussion_r764774539



##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -78,11 +78,24 @@ class GcsIntegrationTest : public ::testing::Test {
     // Initialize a PRNG with a small amount of entropy.
     generator_ = std::mt19937_64(std::random_device()());
     port_ = std::to_string(GetListenPort());
-    auto exe_path = bp::search_path("python3");
-    ASSERT_THAT(exe_path, Not(IsEmpty()));
-
-    server_process_ = bp::child(boost::this_process::environment(), exe_path, 
"-m",
-                                "testbench", "--port", port_, group_);
+    std::vector<std::string> names{"python3", "python"};
+    // If the build script or application developer provides a value in the 
PYTHON
+    // environment variable, then just use that.
+    if (const auto* env = std::getenv("PYTHON")) {
+      names = {env};
+    }
+    for (const auto& interpreter : names) {
+      auto exe_path = bp::search_path(interpreter);
+      if (exe_path.empty()) continue;
+
+      server_process_ = bp::child(boost::this_process::environment(), 
exe_path, "-m",
+                                  "testbench", "--port", port_, group_);
+      if (server_process_.valid() && server_process_.running()) break;
+      server_process_.terminate();
+      server_process_.wait();
+    }
+    ASSERT_TRUE(server_process_.valid());

Review comment:
       What happens if not? Does the user get an error message stating why the 
process failed executing?




-- 
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]


Reply via email to