Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions cpp/src/arrow/filesystem/gcsfs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ class GcsTestbench : public ::testing::Environment {
}

server_process->SetArgs({"--port", port_});
server_process->IgnoreStderr();
// Keep stderr so that startup failures are visible in the test log.
status = server_process->Execute();
if (!status.ok()) {
error += ": " + status.ToString();
error_ = std::move(error);
return;
}

// The testbench may accept connections well before it answers requests,
// so poll with a per-attempt budget shorter than the overall one.
auto testbench_is_running = [&server_process, this]() {
auto ready_timeout = std::chrono::seconds(10);
auto ready_timeout = std::chrono::seconds(60);
auto attempt_timeout = std::chrono::seconds(5);
std::chrono::time_point<std::chrono::steady_clock> end =
std::chrono::steady_clock::now() + ready_timeout;
while (server_process->IsRunning() && std::chrono::steady_clock::now() < end) {
Expand All @@ -95,7 +98,7 @@ class GcsTestbench : public ::testing::Environment {
.set<gcs::RestEndpointOption>("http://127.0.0.1:" + port_)
.set<gc::UnifiedCredentialsOption>(gc::MakeInsecureCredentials())
.set<gcs::RetryPolicyOption>(
gcs::LimitedTimeRetryPolicy(ready_timeout).clone()));
gcs::LimitedTimeRetryPolicy(attempt_timeout).clone()));
auto metadata = client.GetBucketMetadata("nonexistent");
if (metadata.status().code() == google::cloud::StatusCode::kNotFound) {
return true;
Expand All @@ -105,7 +108,7 @@ class GcsTestbench : public ::testing::Environment {
};

if (!testbench_is_running()) {
error += " (failed to listen)";
error += " (did not become ready)";
error_ = std::move(error);
return;
}
Expand Down
Loading