]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test: Extend some timeouts
authorSimon McVittie <smcv@collabora.com>
Fri, 24 Jun 2022 14:10:40 +0000 (15:10 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 13 Jul 2022 19:36:13 +0000 (20:36 +0100)
Group slow tests (those taking about a minute or more in one of the
configurations built on Gitlab-CI) into a new 'slow' suite, which can
be used with `meson test --no-suite=slow` to run just the faster tests.
They default to a 5 minute timeout (usually enough) unless overridden
(bus/dispatch.c can be *very* slow when OOM testing is enabled, and
gets a 30 minute timeout).

For the remaining tests, default to Meson's usual 30 second timeout,
but bump up the timeout a bit in some cases to have a safety margin
(my method was to take the slowest run on our Gitlab-CI, and make sure
we're allowing about 3 times that long).

Signed-off-by: Simon McVittie <smcv@collabora.com>
test/meson.build
test/name-test/meson.build

index 32f866f7d407f7c2ae3171f78846bbee6ea8a2f3..00d0cbfa1f9b73ad81d5e8b0c29866de86ea0c67 100644 (file)
@@ -217,14 +217,15 @@ if embedded_tests
             'srcs': [ 'bus/dispatch-sha1.c' ],
             'link': [ libdbus_testutils, libdbus_daemon_internal, ],
             'install': false,
-            'timeout': 120,
+            'suite': ['slow'],
         },
         {
             'name': 'bus-dispatch',
             'srcs': [ 'bus/dispatch.c' ],
             'link': [ libdbus_testutils, libdbus_daemon_internal, ],
             'install': false,
-            'timeout': 120,
+            'suite': ['slow'],
+            'timeout': 3000,
         },
         {
             'name': 'marshal-recursive',
@@ -234,6 +235,7 @@ if embedded_tests
             ],
             'link': [ libdbus_testutils, ],
             'install': false,
+            'timeout': 60,
         },
         {
             'name': 'message-internals',
@@ -245,6 +247,7 @@ if embedded_tests
             ],
             'link': [ libdbus_testutils, ],
             'install': false,
+            'suite': ['slow'],
         },
     ]
 
@@ -378,7 +381,7 @@ if use_glib
             'srcs': [ 'dbus-daemon.c' ],
             'link': [ libdbus_testutils, ],
             'deps': [ glib, gio, ],
-            'suite': ['runs-dbus-daemon'],
+            'suite': ['runs-dbus-daemon', 'slow'],
         },
         {
             'name': 'dbus-daemon-eavesdrop',
@@ -404,8 +407,7 @@ if use_glib
             'srcs': [ 'header-fields.c' ],
             'link': [ libdbus_testutils, ],
             'deps': [ glib, gio, ],
-            'timeout': 120,
-            'suite': ['runs-dbus-daemon'],
+            'suite': ['runs-dbus-daemon', 'slow'],
         },
         {
             'name': 'message',
@@ -419,6 +421,7 @@ if use_glib
             'link': [ libdbus_testutils, ],
             'deps': [ glib, gio, ],
             'suite': ['runs-dbus-daemon'],
+            'timeout': 45,
         },
         {
             'name': 'loopback',
@@ -437,12 +440,14 @@ if use_glib
             'srcs': [ 'internals/refs.c' ],
             'link': [ libdbus_testutils, ],
             'deps': [ glib, gio, ],
+            'suite': ['slow'],
         },
         {
             'name': 'relay',
             'srcs': [ 'relay.c' ],
             'link': [ libdbus_testutils, ],
             'deps': [ glib, gio, ],
+            'timeout': 60,
         },
         {
             'name': 'server-oom',
@@ -522,9 +527,16 @@ foreach test: tests
     link = test.get('link', [])
     deps = test.get('deps', [])
     suites = test.get('suite', ['dbus'])
-    timeout = test.get('timeout', 30)
     install = test.get('install', true)
 
+    if 'slow' in suites
+        timeout = 300
+    else
+        timeout = 30
+    endif
+
+    timeout = test.get('timeout', timeout)
+
     test_exe = executable('test-' + name,
         srcs,
         link_with: link,
index 68f0bd27752cc0f20b927e0fb6027fc347df4b99..1d1893f4f6f57d736388f14e1fb6ef26e81a2522 100644 (file)
@@ -55,6 +55,14 @@ if embedded_tests
             continue
         endif
 
+        if test == 'test-pending-call-timeout'
+            timeout = 75
+            suites = ['name-test', 'slow']
+        else
+            timeout = 30
+            suites = ['name-test']
+        endif
+
         test(test,
             dbus_run_session,
             args: [
@@ -66,6 +74,8 @@ if embedded_tests
             ],
             env: test_env,
             protocol: 'tap',
+            suite: suites,
+            timeout: timeout,
         )
     endforeach
 
@@ -75,12 +85,14 @@ if embedded_tests
             find_program('run-test.sh'),
             env: test_env,
             protocol: 'tap',
+            suite: 'name-test',
         )
 
         test('run-test-systemserver',
             find_program('run-test-systemserver.sh'),
             env: test_env,
             protocol: 'tap',
+            suite: 'name-test',
         )
     endif
 endif