summaryrefslogtreecommitdiff
path: root/test/internals/refs.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-09-27 13:14:39 +0100
committerSimon McVittie <smcv@collabora.com>2017-09-27 14:45:49 +0100
commit3d557ff7b155d1e0f1cdbfd82cff0ac7ed1b7c4b (patch)
tree29014f8bdc2d88424a86271818f3c12c41e6160c /test/internals/refs.c
parent5aca0fc1a5bc0b7918839bc692747b1f57c3285c (diff)
tests: In slower tests, make the timeout per-test-case
Some test-cases in the dbus-daemon and relay tests spam the bus with thousands of messages, which can take 25 seconds on slower CPUs like MIPS. Similarly, the refs test spams millions of refcount operations, which it appears might take more than a minute on PA-RISC (HPPA). To get an idea of how close we are to having a problem on other architectures, log a message and start a timer when we reset the timeout in setup(), and log the elapsed time when we reach teardown(). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103009 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com>
Diffstat (limited to 'test/internals/refs.c')
-rw-r--r--test/internals/refs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/internals/refs.c b/test/internals/refs.c
index f9776378..3c6b438d 100644
--- a/test/internals/refs.c
+++ b/test/internals/refs.c
@@ -201,6 +201,9 @@ setup (Fixture *f,
if (!dbus_threads_init_default ())
g_error ("OOM");
+ /* This can be fairly slow, so make the test timeout per-test */
+ test_timeout_reset ();
+
f->n_threads = N_THREADS;
f->n_refs = N_REFS;