pitrou commented on code in PR #43766:
URL: https://github.com/apache/arrow/pull/43766#discussion_r1735928625
##########
cpp/src/arrow/filesystem/gcsfs_test.cc:
##########
@@ -89,70 +67,64 @@ class GcsTestbench : public ::testing::Environment {
public:
GcsTestbench() {
port_ = std::to_string(GetListenPort());
- 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};
- }
auto error = std::string("Could not start GCS emulator
'storage-testbench'");
+ auto server_process = std::make_unique<util::Process>();
+ auto status = server_process->SetExecutable("storage-testbench");
+ if (!status.ok()) {
+ error += " (exe not found)";
+ error_ = std::move(error);
+ return;
Review Comment:
Why not simply
```suggestion
error += ": " + status.ToString();
error_ = std::move(error);
return;
```
##########
cpp/src/arrow/filesystem/gcsfs_test.cc:
##########
@@ -89,70 +67,64 @@ class GcsTestbench : public ::testing::Environment {
public:
GcsTestbench() {
port_ = std::to_string(GetListenPort());
- 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};
- }
auto error = std::string("Could not start GCS emulator
'storage-testbench'");
+ auto server_process = std::make_unique<util::Process>();
+ auto status = server_process->SetExecutable("storage-testbench");
+ if (!status.ok()) {
+ error += " (exe not found)";
+ error_ = std::move(error);
+ return;
+ }
- auto testbench_is_running = [](bp::child& process, bp::ipstream& output) {
- // Wait for message: "* Restarting with"
- std::string line;
+ server_process->SetArgs({"--port", port_});
+ server_process->IgnoreStderr();
+ status = server_process->Execute();
+ if (!status.ok()) {
+ error += " (failed to launch: ";
Review Comment:
Same here.
--
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]