tests: classify some ivshmem tests as slow
PATCH 1/1 tests: classify some ivshmem tests as slow
From: Marc-André Lureau <[email protected]>
Some tests may take long to run, move them under g_test_slow() condition.
The 5s timeout for the "server" test will have to be adjusted to the worst known time (for the records, it takes ~0.2s on my host). The "pair" test takes ~1.7, a quickest version could be implemented.
--- tests/ivshmem-test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tests/ivshmem-test.c +4 -2
@@ -478,10 +478,12 @@ int main(int argc, char **argv) tmpserver =g_strconcat (tmpdir,"/server" ,NULL );qtest_add_func ("/ivshmem/single" , test_ivshmem_single); -qtest_add_func ("/ivshmem/pair" , test_ivshmem_pair); -qtest_add_func ("/ivshmem/server" , test_ivshmem_server);qtest_add_func ("/ivshmem/hotplug" , test_ivshmem_hotplug);qtest_add_func ("/ivshmem/memdev" , test_ivshmem_memdev); +if (g_test_slow ()) { +qtest_add_func ("/ivshmem/pair" , test_ivshmem_pair); +qtest_add_func ("/ivshmem/server" , test_ivshmem_server); + } ret =g_test_run ();
Signature · 1 line
2.5.0
Quoted 8 lines · [email protected] writes:
From: Marc-André Lureau <[email protected]>
Some tests may take long to run, move them under
g_test_slow()condition.The 5s timeout for the "server" test will have to be adjusted to the worst known time (for the records, it takes ~0.2s on my host). The "pair" test takes ~1.7, a quickest version could be implemented.
Sounds like you need a FIXME comment there.
Quoted 8 lines · On 12 November 2015 at 11:10, <[email protected]> wrote:
From: Marc-André Lureau <[email protected]>
Some tests may take long to run, move them under
g_test_slow()condition.The 5s timeout for the "server" test will have to be adjusted to the worst known time (for the records, it takes ~0.2s on my host). The "pair" test takes ~1.7, a quickest version could be implemented.
I assume your host is using KVM, so it's not very interesting from the point of view of trying to measure worst-case runtime... You need to find a moderately slow non-x86 host and time that.
Quoted 13 lines
Signed-off-by Marc-André Lureau <[email protected]>--- tests/ivshmem-test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tests/ivshmem-test.c +0
-0@@ -478,10 +478,12 @@ int main(int argc, char **argv) tmpserver =g_strconcat (tmpdir,"/server" ,NULL );qtest_add_func ("/ivshmem/single" , test_ivshmem_single);
tests/ivshmem-test.c int main(int argc, char **argv) · line 488
Quoted 10 lines
tests/ivshmem-test.c +4
-2-qtest_add_func ("/ivshmem/pair" , test_ivshmem_pair); -qtest_add_func ("/ivshmem/server" , test_ivshmem_server);qtest_add_func ("/ivshmem/hotplug" , test_ivshmem_hotplug);qtest_add_func ("/ivshmem/memdev" , test_ivshmem_memdev); +if (g_test_slow ()) { +qtest_add_func ("/ivshmem/pair" , test_ivshmem_pair); +qtest_add_func ("/ivshmem/server" , test_ivshmem_server); + } ret =g_test_run ();
I've applied this to master anyway, but we should look at a more permanent/general fix too.
thanks
-- PMM