[PATCH] Increase timeout for tests and syntax-check

Michal Privoznik mprivozn at redhat.com
Wed Jan 27 17:59:58 UTC 2021


Since we've switched to meson our tests run with a timeout (meson
uses 30 seconds as the default). However, not every machine that
builds libvirt is fast enough to run every test under 30 seconds
(each test binary has its own timeout, but still). For instance
when building a package for distro on a farm that's under load.
Or on a generally slow ARM hardware. While each developer can
tune their command line for building by adding
--timeout-multiplier=10, this is hard to do for aforementioned
build farms.

It's time to admit that not everybody has the latest, top shelf
CPU and increase the timeout.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---

Successfully tested on my RasPi 2B, where the top three longest test
were:

  qemuxml2argvtest              OK  142.43s
  virschematest                 OK  40.82s
  virnettlssessiontest          OK  38.64s

and syntax-check:

 sc_spacing-check               OK  50.26
 sc_avoid_if_before_free        OK  42.30s
 sc_prohibit_cross_inclusion    OK  40.51s

 build-aux/meson.build |  1 +
 tests/meson.build     | 14 ++++++--------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/build-aux/meson.build b/build-aux/meson.build
index c506feefd2..e7b2db8759 100644
--- a/build-aux/meson.build
+++ b/build-aux/meson.build
@@ -44,6 +44,7 @@ if git
         potfiles_dep,
       ],
       suite: 'syntax-check',
+      timeout: 120,
     )
   endforeach
 endif
diff --git a/tests/meson.build b/tests/meson.build
index 0de0783839..702090d594 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -546,6 +546,10 @@ if conf.has('WITH_YAJL')
   ]
 endif
 
+# Increase the default timeout because some tests may run longer,
+# esp. on slower systems.
+timeout = 180
+
 foreach data : tests
   test_sources = '@0 at .c'.format(data['name'])
   test_bin = executable(
@@ -577,12 +581,6 @@ foreach data : tests
     ],
     export_dynamic: true,
   )
-  if data['name'] == 'qemuxml2argvtest'
-    timeout = 90
-  else
-    # default meson timeout
-    timeout = 30
-  endif
   test(data['name'], test_bin, env: tests_env, timeout: timeout)
 endforeach
 
@@ -683,7 +681,7 @@ endif
 
 foreach name : test_scripts
   script = find_program(name)
-  test(name, script, env: tests_env)
+  test(name, script, env: tests_env, timeout: timeout)
 endforeach
 
 add_test_setup(
@@ -703,6 +701,6 @@ add_test_setup(
     '--suppressions=@0@'.format(meson.current_source_dir() / '.valgrind.supp'),
     '--error-exitcode=1',
   ],
-  # default timeout in meson is 30s
+  # Tests take a lot longer when run under Valgrind
   timeout_multiplier: 4,
 )
-- 
2.26.2




More information about the libvir-list mailing list