From 39a19804a452779be5d80caded9ac96ccdfae53b Mon Sep 17 00:00:00 2001 From: Jonas Dedden Date: Wed, 26 Aug 2026 13:12:10 +0200 Subject: [PATCH] GH-51011: [C++][CI] Poll for GCS testbench readiness instead of one 10s attempt The 10s startup budget was also passed to LimitedTimeRetryPolicy, so the readiness loop made a single attempt. Use 5s per attempt and 60s overall, and keep the testbench's stderr so startup failures show up in CI logs. --- cpp/src/arrow/filesystem/gcsfs_test.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cpp/src/arrow/filesystem/gcsfs_test.cc b/cpp/src/arrow/filesystem/gcsfs_test.cc index e174638b5359..a8637377aa0b 100644 --- a/cpp/src/arrow/filesystem/gcsfs_test.cc +++ b/cpp/src/arrow/filesystem/gcsfs_test.cc @@ -77,7 +77,7 @@ 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(); @@ -85,8 +85,11 @@ class GcsTestbench : public ::testing::Environment { 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 end = std::chrono::steady_clock::now() + ready_timeout; while (server_process->IsRunning() && std::chrono::steady_clock::now() < end) { @@ -95,7 +98,7 @@ class GcsTestbench : public ::testing::Environment { .set("http://127.0.0.1:" + port_) .set(gc::MakeInsecureCredentials()) .set( - 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; @@ -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; }