Skip to content

Commit

Permalink
Merge pull request #364 from Enmk/attempt_to_fix_test_failures_on_CICD
Browse files Browse the repository at this point in the history
Attempt to fix test failures on remote machines
  • Loading branch information
Enmk committed Feb 28, 2024
2 parents a039d97 + 4a86deb commit 0fb4835
Show file tree
Hide file tree
Showing 4 changed files with 635 additions and 41 deletions.
26 changes: 21 additions & 5 deletions clickhouse/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,30 @@ struct ClientInfo {
uint32_t client_revision = 0;
};

std::ostream& operator<<(std::ostream& os, const Endpoint& endpoint) {
return os << endpoint.host << ":" << endpoint.port;
}

std::ostream& operator<<(std::ostream& os, const ClientOptions& opt) {
os << "Client(" << opt.user << '@' << opt.host << ":" << opt.port
<< "Endpoints :";
for (size_t i = 0; i < opt.endpoints.size(); i++)
os << opt.user << '@' << opt.endpoints[i].host << ":" << opt.endpoints[i].port
os << "Client("
<< " Endpoints : [";
size_t extra_endpoints = 0;

if (!opt.host.empty()) {
extra_endpoints = 1;
os << opt.user << '@' << Endpoint{opt.host, opt.port};

if (opt.endpoints.size())
os << ", ";
}

for (size_t i = 0; i < opt.endpoints.size(); i++) {
os << opt.user << '@' << opt.endpoints[i]
<< ((i == opt.endpoints.size() - 1) ? "" : ", ");
}

os << " ping_before_query:" << opt.ping_before_query
os << "] (" << opt.endpoints.size() + extra_endpoints << " items )"
<< " ping_before_query:" << opt.ping_before_query
<< " send_retries:" << opt.send_retries
<< " retry_timeout:" << opt.retry_timeout.count()
<< " compression_method:"
Expand Down
1 change: 1 addition & 0 deletions clickhouse/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ struct ClientOptions {
};

std::ostream& operator<<(std::ostream& os, const ClientOptions& options);
std::ostream& operator<<(std::ostream& os, const Endpoint& options);

class SocketFactory;

Expand Down
Loading

0 comments on commit 0fb4835

Please sign in to comment.