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 <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2022-06-24 15:10:40 +01:00
parent b228b478a4
commit 09ebed95ea
2 changed files with 30 additions and 6 deletions

View 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,

View 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