Fix unit test

This commit is contained in:
Alexey Milovidov 2023-10-28 20:04:10 +02:00
parent 18e238e7c6
commit 753ea3ab88
3 changed files with 9 additions and 2 deletions

View File

@ -548,6 +548,7 @@ public:
void setZooKeeperLog(std::shared_ptr<DB::ZooKeeperLog> zk_log_);
UInt32 getSessionUptime() const { return static_cast<UInt32>(session_uptime.elapsedSeconds()); }
bool hasReachedDeadline() const { return impl->hasReachedDeadline(); }
void setServerCompletelyStarted();

View File

@ -26,12 +26,16 @@ std::optional<RaftServerConfig> RaftServerConfig::parse(std::string_view server)
if (!with_id_endpoint && !with_server_type && !with_priority)
return std::nullopt;
const std::string_view id_str = parts[0];
std::string_view id_str = parts[0];
if (!id_str.starts_with("server."))
return std::nullopt;
id_str = id_str.substr(7);
if (auto eq_pos = id_str.find('='); std::string_view::npos != eq_pos)
id_str = id_str.substr(0, eq_pos);
Int32 id;
if (!tryParse(id, std::next(id_str.begin(), 7)))
if (!tryParse(id, id_str))
return std::nullopt;
if (id <= 0)
return std::nullopt;

View File

@ -1,4 +1,5 @@
#pragma once
#include <map>
#include <mutex>
#include <unordered_map>
@ -12,6 +13,7 @@
#include <Common/Stopwatch.h>
#include <Common/ThreadPool.h>
namespace Poco
{
class Logger; // NOLINT(cppcoreguidelines-virtual-class-destructor)