通过单例实现initplugin,修复用例引用问题,防止重复创建plugin #1549
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
测试用例引用testcase时会出现每次调用testcase都会实例化一个plugin,导致性能测试时引用testcase出现实例化n个plugin,大量消耗cpu,导致性能数据不准确
解决方案:
1、不同的用例,可以使用不同的debugtalk.py文件
2、调用initPlugin时做读写锁操作,由于兼容不同的用例使用不同的debugtalk.py,所以无法用once.do的操作