|
|
@@ -16,7 +16,7 @@ const SECRET_KEY: &str = "";
|
|
|
|
|
|
|
|
|
//ws-订阅公共频道信息
|
|
|
-#[tokio::test(flavor = "multi_thread", worker_threads = 8)]
|
|
|
+#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
|
|
async fn ws_custom_subscribe() {
|
|
|
global::log_utils::init_log_with_trace();
|
|
|
|
|
|
@@ -53,10 +53,13 @@ async fn ws_custom_subscribe() {
|
|
|
trace_stack.on_before_unlock_quant();
|
|
|
trace_stack.on_after_network(data.time);
|
|
|
|
|
|
- if data.time != 0 {
|
|
|
- let delay = trace_stack.before_unlock_quant - trace_stack.after_network;
|
|
|
- max_delay = max(max_delay, delay);
|
|
|
- info!("{}us, max={}us", delay, max_delay);
|
|
|
+ let delay = trace_stack.before_unlock_quant - trace_stack.after_network;
|
|
|
+ max_delay = max(max_delay, delay);
|
|
|
+ info!("{}us, max={}us", delay, max_delay);
|
|
|
+
|
|
|
+ // 从通道中接收并丢弃所有的消息,直到通道为空
|
|
|
+ while let Ok(Some(_)) = read_rx.try_next() {
|
|
|
+ // 消息被忽略
|
|
|
}
|
|
|
}
|
|
|
}
|