| 122 | }; |
| 123 | |
| 124 | Status WaitForReady(FlightClient* client, const FlightCallOptions& call_options) { |
| 125 | Action action{"ping", nullptr}; |
| 126 | for (int attempt = 0; attempt < 10; attempt++) { |
| 127 | auto result_stream_result = client->DoAction(call_options, action); |
| 128 | if (result_stream_result.ok() && (*result_stream_result)->Drain().ok()) { |
| 129 | return Status::OK(); |
| 130 | } |
| 131 | std::this_thread::sleep_for(std::chrono::milliseconds(1000)); |
| 132 | } |
| 133 | return Status::IOError("Server was not available after 10 attempts"); |
| 134 | } |
| 135 | |
| 136 | arrow::Result<PerformanceResult> RunDoGetTest(FlightClient* client, |
| 137 | const FlightCallOptions& call_options, |