Fix time/tst-cpuclock1 intermitent failures
commit04deeaa9ea74b0679dfc9d9155a37b6425f19a9f
authorLucas A. M. Magalhaes <lamm@linux.ibm.com>
Fri, 10 Jul 2020 22:41:06 +0000 (10 19:41 -0300)
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Fri, 10 Jul 2020 22:41:06 +0000 (10 19:41 -0300)
tree1c45c61f362a93a31f919fe2d428898720b59e1d
parent7c7bcf3634e44cf7e001aaa302138c1ee0e58f8c
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>
support/Makefile
support/timespec.c
support/timespec.h
support/tst-timespec.c [new file with mode: 0644]
time/tst-cpuclock1.c