Skip to content

Commit

Permalink
extend server wait time
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengjian526 committed Jan 27, 2024
1 parent 8a74124 commit e80f74a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/test_rest_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ TEST_CASE("test_client_default_constructor") {
dummy d;
server.register_handler("add", &dummy::add, &d);
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));

rpc_client client;
client.update_addr("127.0.0.1", 9000);
Expand All @@ -88,7 +88,7 @@ TEST_CASE("test_constructor_with_language") {
dummy d;
server.register_handler("add", &dummy::add, &d);
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));

rpc_client client(client_language_t::CPP, nullptr);
bool r = client.connect("127.0.0.1", 9000);
Expand All @@ -102,7 +102,7 @@ TEST_CASE("test_client_async_connect") {
dummy d;
server.register_handler("add", &dummy::add, &d);
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));

rpc_client client;
client.async_connect("127.0.0.1", 9000);
Expand All @@ -120,7 +120,7 @@ TEST_CASE("test_client_sync_call") {
dummy d;
server.register_handler("add", &dummy::add, &d);
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));

rpc_client client("127.0.0.1", 9000);
bool r = client.connect();
Expand All @@ -133,7 +133,7 @@ TEST_CASE("test_client_sync_call_return_void") {
rpc_server server(9000, std::thread::hardware_concurrency());
server.register_handler("echo", echo);
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));

rpc_client client("127.0.0.1", 9000);
bool r = client.connect();
Expand All @@ -146,7 +146,7 @@ TEST_CASE("test_client_async_call") {
server.register_handler("get_person", get_person);
server.register_handler("hello", hello);
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));

rpc_client client("127.0.0.1", 9000);
bool r = client.connect();
Expand Down Expand Up @@ -181,7 +181,7 @@ TEST_CASE("test_client_async_call_with_timeout") {
rpc_server server(9000, std::thread::hardware_concurrency());
server.register_handler("echo", echo);
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));

rpc_client client;
bool r = client.connect("127.0.0.1", 9000);
Expand Down Expand Up @@ -217,7 +217,7 @@ TEST_CASE("test_client_subscribe") {
}
});
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));
rpc_client client;
bool r = client.connect("127.0.0.1", 9000);
CHECK(r);
Expand Down Expand Up @@ -245,7 +245,7 @@ TEST_CASE("test_server_publish_encode_msg") {
}
});
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));
rpc_client client;
bool r = client.connect("127.0.0.1", 9000);
CHECK(r);
Expand Down Expand Up @@ -277,7 +277,7 @@ TEST_CASE("test_client_subscribe_by_token") {
}
});
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));
rpc_client client;
bool r = client.connect("127.0.0.1", 9000);
CHECK(r);
Expand All @@ -304,7 +304,7 @@ TEST_CASE("test_server_callback") {
std::cout << "connect id : " << conn_id << " timeout \n";
});
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));

rpc_client client("127.0.0.1", 9000);
bool r = client.connect();
Expand All @@ -316,7 +316,7 @@ TEST_CASE("test_server_user_data") {
rpc_server server(9000, std::thread::hardware_concurrency());
server.register_handler("server_user_data", server_user_data);
server.async_run();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(200));

rpc_client client("127.0.0.1", 9000);
bool r = client.connect();
Expand Down

0 comments on commit e80f74a

Please sign in to comment.