From 09ebed95ea6db98aec2a9fcea6bc86202798e96b Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 24 Jun 2022 15:10:40 +0100 Subject: [PATCH] test: Extend some timeouts 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 --- test/meson.build | 24 ++++++++++++++++++------ test/name-test/meson.build | 12 ++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/test/meson.build b/test/meson.build index 32f866f7d..00d0cbfa1 100644 --- a/test/meson.build +++ b/test/meson.build @@ -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, diff --git a/test/name-test/meson.build b/test/name-test/meson.build index 68f0bd277..1d1893f4f 100644 --- a/test/name-test/meson.build +++ b/test/name-test/meson.build @@ -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 -- 2.47.3