This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Speedup various nptl/tst-mutex5 tests.
- From: Stefan Liebler <stli at linux dot ibm dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 12 Sep 2019 14:16:09 +0200
- Subject: [PATCH] Speedup various nptl/tst-mutex5 tests.
Hi,
each of these tests - tst-mutex5, tst-mutex5a, tst-mutexpi5
and tst-mutexpi5a - runs for 6s.
do_test_clock is called three times, which tries to lock the mutex
which times out after 2 seconds.
This patch reduces the timeout to 0.3 seconds which leads to a
runtime of roughly 0.9s for one tst-mutex5... invocation.
As the nptl tests run in sequence, this patch saves roughly 20s of
runtime for "make check".
Bye,
Stefan
ChangeLog:
* nptl/tst-mutex5.c (do_test_clock): Reduce timeout.
commit 50f17c94072cb2a28290ec2d0502dcd9d925b61c
Author: Stefan Liebler <stli@linux.ibm.com>
Date: Wed Sep 11 10:53:48 2019 +0200
Speedup various nptl/tst-mutex5 tests.
Each of these tests - tst-mutex5, tst-mutex5a, tst-mutexpi5
and tst-mutexpi5a - runs for 6s.
do_test_clock is called three times, which tries to lock the mutex
which times out after 2 seconds.
This patch reduces the timeout to 0.3 seconds which leads to a
runtime of roughly 0.9s for one tst-mutex5... invocation.
As the nptl tests run in sequence, this patch saves roughly 20s of
runtime for "make check".
ChangeLog:
* nptl/tst-mutex5.c (do_test_clock): Reduce timeout.
diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c
index 1ecb483d4d..2f26637301 100644
--- a/nptl/tst-mutex5.c
+++ b/nptl/tst-mutex5.c
@@ -66,9 +66,9 @@ do_test_clock (clockid_t clockid, const char *fnname)
if (pthread_mutex_trylock (&m) == 0)
FAIL_EXIT1 ("mutex_trylock succeeded");
- /* Wait 2 seconds. */
+ /* Wait 0.3 seconds. */
struct timespec ts_timeout = timespec_add (xclock_now (clockid_for_get),
- make_timespec (2, 0));
+ make_timespec (0, 300000000));
if (clockid == CLOCK_USE_TIMEDLOCK)
TEST_COMPARE (pthread_mutex_timedlock (&m, &ts_timeout), ETIMEDOUT);