testcases中test_rpc_server1.cc与test_rpc_server2.cc是否需要更新一下
peterguo97 opened this issue · 2 comments
这两个文件是否需要更新一下与quick_rpc_test.md保持一致😀
在test_rpc_server1.cc文件中会休眠6s
DebugLog << "this is query_name func";
DebugLog << "first begin to sleep 6s";
sleep_hook(6);
DebugLog << "sleep 6s end";
而在test_rpc_server2.cc中tcp_connection的超时时间为1s。
rpc_controller.SetTimeout(1000);
导致在使用测试用例时,会出现包发出去还没收到,此时就超时了,导致无法看到返回结果,会让人感到疑惑
[2022-05-18 12:19:25.94814] [INFO] [53269] [53269] [1] [tinyrpc/net/tcp/tcp_connection.cc:214] send[79] bytes data to [127.0.0.1:39999], fd [13]
[2022-05-18 12:19:25.94839] [INFO] [53269] [53269] [1] [tinyrpc/net/tcp/tcp_connection.cc:217] send all data, now unregister write event and break
[2022-05-18 12:19:25.94865] [DEBUG] [53269] [53269] [1] [tinyrpc/net/tcp/tcp_connection.cc:279] 82061641944973154118|reply data not exist
[2022-05-18 12:19:25.94889] [DEBUG] [53269] [53269] [1] [tinyrpc/net/tcp/tcp_connection.cc:114] m_read_buffer size=128rd=0wd=0
[2022-05-18 12:19:25.94914] [DEBUG] [53269] [53269] [1] [tinyrpc/coroutine/coroutine_hook.cc:55] this is hook read
[2022-05-18 12:19:25.94956] [DEBUG] [53269] [53269] [1] [tinyrpc/net/fd_event.cc:120] fd already set o_nonblock
[2022-05-18 12:19:25.94984] [DEBUG] [53269] [53269] [1] [tinyrpc/coroutine/coroutine_hook.cc:34] fd:[13], register read event to epoll
[2022-05-18 12:19:25.95009] [DEBUG] [53269] [53269] [1] [tinyrpc/net/reactor.cc:179] epoll_ctl add succ, fd[13]
[2022-05-18 12:19:25.95031] [DEBUG] [53269] [53269] [1] [tinyrpc/coroutine/coroutine_hook.cc:87] read func to yield
[2022-05-18 12:19:26.55967] [INFO] [53269] [53269] [0] [tinyrpc/net/tcp/tcp_client.cc:49] TcpClient timer out event occur
哈哈,这是我问故意在测试超时的情况。 晚点我回去更新一下。
已更新了。并且添加了 MYSQL 的封装,有兴趣可以尝试下。