1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Fix time/tst-cpuclock1 intermitent failures

This test fails intermittently in systems with heavy load as
CLOCK_PROCESS_CPUTIME_ID is subject to scheduler pressure.  Thus the
test boundaries were relaxed to keep it from failing on such systems.

A refactor of the spent time checking was made with some support
functions.  With the advantage to representing time jitter in percent
of the target.

The values used by the test boundaries are all empirical.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Lucas A. M. Magalhaes
2020-07-10 19:41:06 -03:00
committed by Tulio Magno Quites Machado Filho
parent 7c7bcf3634
commit 04deeaa9ea
5 changed files with 415 additions and 30 deletions

View File

@@ -48,6 +48,14 @@ void test_timespec_equal_or_after_impl (const char *file, int line,
const struct timespec left,
const struct timespec right);
long support_timespec_ns (struct timespec time);
struct timespec support_timespec_normalize (struct timespec time);
int support_timespec_check_in_range (struct timespec expected, struct timespec observed,
double lower_bound, double upper_bound);
/* Check that the timespec on the left represents a time before the
time on the right. */
#define TEST_TIMESPEC_BEFORE(left, right) \