avocado/core/loader.py: make sure loaders are only registered once
Long story short, after taking a look at: https://github.com/avocado-framework/avocado-vt/issues/322 I noticed that, on purpose, the VirtTestLoader class would be registered both by `avocado_vt/plugins/vt.py` and avocado_vt/plugins/vt_list.py`. The reasoning is simply to keep plugins independent, without depending on each other. But, it turns out the registering the loader on both places doubles the time it takes to find VT tests. Without this patch: $ /usr/bin/time ./scripts/avocado list > /dev/null 9.52user 0.17system 0:09.68elapsed 100%CPU (0avgtext+0avgdata 189528maxresident)k 0inputs+3744outputs (0major+63564minor)pagefaults 0swaps With this patch: $ /usr/bin/time ./scripts/avocado list > /dev/null 5.47user 0.13system 0:05.60elapsed 100%CPU (0avgtext+0avgdata 145716maxresident)k 0inputs+1920outputs (0major+51958minor)pagefaults 0swaps Signed-off-by: NCleber Rosa <crosa@redhat.com>
Showing
想要评论请 注册 或 登录