-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mpm integration-test hangs in rpc-fork mode, update test case on halley chain #3653
Conversation
vm/starcoin-transactional-test-harness/tests/cases/call_api_cmd_halley.move
Outdated
Show resolved
Hide resolved
vm/starcoin-transactional-test-harness/tests/cases/call_api_cmd_halley.move
Outdated
Show resolved
Hide resolved
vm/starcoin-transactional-test-harness/tests/cases/call_api_cmd_halley.move
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #3653 +/- ##
==========================================
+ Coverage 28.65% 28.75% +0.11%
==========================================
Files 591 591
Lines 50691 50686 -5
Branches 23903 23868 -35
==========================================
+ Hits 14518 14570 +52
- Misses 21928 21989 +61
+ Partials 14245 14127 -118
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
vm/starcoin-transactional-test-harness/tests/cases/call_api_cmd_halley.move
Outdated
Show resolved
Hide resolved
vm/starcoin-transactional-test-harness/tests/cases/call_api_cmd_halley.move
Outdated
Show resolved
Hide resolved
impl Drop for MockServer { | ||
fn drop(&mut self) { | ||
self.server_handle.abort(); | ||
Ok(( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
主要是这里导致卡住?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前用 tokio Runtime::spawn 启动 local server 的 server 端,然后 server 内部会用 futures::block_on 去执行 remote Client 的请求, 这样的用法会卡住。
server 内部用 Runtime::handle::block_on 去执行 remote Client 的请求,就会出现 nested Runtime 的问题。
现在是改成用 thread::spawn 启动 local server, server 内部用 Runtime::handle::block_on 其执行请求,就没问题了。
这里删掉 Drop 是因为启动 local server 的 thread::JoinHandle 没找到中断线程的方法,也就是没管 local server 的停机问题了。mpm 的场景下用应该也没啥问题,如果有解决方案当然更好。
我来验证下这个问题,另外跑下另外的几个tesecase |
验证在halley还是会hang住。 |
我验证了一下这个 case, 不会卡住。可能测试时网络不好? 另外 fork 过程会从远程节点读取状态,可能会有点慢,可以多等一会看看(我跑这个 case 总共运行大约 35s)。 |
@baichuan3 可以更新一下 starcoin-framework 用的 mpm 版本,然后放 ci 里测。 |
确实成功了,就是比较慢,每次大概2~3分钟 |
@jolestar rpc fork 初始化的时候,会更新 state tree,导致需要读取数十个 state tree 节点, 这些节点都要通过 rpc 从远程获取,这个过程确实有点长,体验不是很好。 |
dry run 的时候也有类似的问题。这种可能需要看看有没有办法批量获取。另外如果网络好的话其实问题应该也不大。 |
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information
@baichuan3 方便提供更多的 DAO 测试 case 吗? 我也可以一起测一下看看。