diff --git a/include/ylt/coro_io/client_pool.hpp b/include/ylt/coro_io/client_pool.hpp index 23365bfa4..d797b060e 100644 --- a/include/ylt/coro_io/client_pool.hpp +++ b/include/ylt/coro_io/client_pool.hpp @@ -550,6 +550,10 @@ class client_pools { ELOG_DEBUG << "add new client pool of {" << host_name << "} to hash table"; } + else { + ELOG_DEBUG << "add new client pool of {" << host_name + << "} failed, element existed."; + } } return iter->second; } diff --git a/src/coro_io/tests/test_client_pool.cpp b/src/coro_io/tests/test_client_pool.cpp index 4f9499dae..f4cff502e 100644 --- a/src/coro_io/tests/test_client_pool.cpp +++ b/src/coro_io/tests/test_client_pool.cpp @@ -108,6 +108,7 @@ TEST_CASE("test client pool") { CHECK(pool->free_client_count() == 0); server.stop(); }()); + ELOG_DEBUG << "test client pool over."; } TEST_CASE("test idle timeout yield") { async_simple::coro::syncAwait([]() -> async_simple::coro::Lazy { @@ -127,6 +128,7 @@ TEST_CASE("test idle timeout yield") { CHECK(pool->free_client_count() == 0); server.stop(); }()); + ELOG_DEBUG << "test idle timeout yield over."; } TEST_CASE("test reconnect") { @@ -149,6 +151,7 @@ TEST_CASE("test reconnect") { server.stop(); co_return; }()); + ELOG_DEBUG << "test reconnect over."; } struct mock_client : public coro_rpc::coro_rpc_client { @@ -161,7 +164,7 @@ struct mock_client : public coro_rpc::coro_rpc_client { co_return ec; } }; -TEST_CASE("test reconnect retry wait time exinclude reconnect cost time") { +TEST_CASE("test reconnect retry wait time exclude reconnect cost time") { async_simple::coro::syncAwait([]() -> async_simple::coro::Lazy { auto tp = std::chrono::steady_clock::now(); auto pool = coro_io::client_pool::create( @@ -184,6 +187,8 @@ TEST_CASE("test reconnect retry wait time exinclude reconnect cost time") { server.stop(); co_return; }()); + ELOG_DEBUG + << "test reconnect retry wait time exclude reconnect cost time over."; } TEST_CASE("test collect_free_client") { @@ -204,6 +209,7 @@ TEST_CASE("test collect_free_client") { server.stop(); co_return; }()); + ELOG_DEBUG << "test collect_free_client over."; } TEST_CASE("test client pools parallel r/w") { @@ -214,8 +220,10 @@ TEST_CASE("test client pools parallel r/w") { CHECK(cli->get_host_name() == std::to_string(i)); } auto rw = [&pool](int i) -> Lazy { + ELOG_DEBUG << "start to insert {" << i << "} to hash table."; auto cli = pool[std::to_string(i)]; CHECK(cli->get_host_name() == std::to_string(i)); + ELOG_DEBUG << "end to insert {" << i << "} to hash table."; co_return; }; @@ -228,4 +236,5 @@ TEST_CASE("test client pools parallel r/w") { } co_await collectAll(std::move(works)); }()); + ELOG_DEBUG << "test client pools parallel r/w over."; } \ No newline at end of file