Tags: patch
The galera-3 testcase fails on hppa/parisc and alpha with:
gcs/src/unit_tests/gcs_sm_test.cpp:283:F:gcs_sm:gcs_sm_test_pause:0: Failure
'tmp <= paused_ns' occurred
The reason for this failure is, that galera-3 uses
clock_gettime (CLOCK_MONOTONIC, &tmp);
in function gu_time_monotonic() in file galerautils/src/gu_time.h
to get the current time.
Many platforms like x86 do have a very fine granularity when getting the
monotonic clock, so
the test in ./gcs/src/unit_tests/gcs_sm_test.cpp:
fail_if (tmp <= paused_ns);
will succeed.
Other platforms like hppa and alpha don't have such a fine granularity and
ensure
that the value returned by CLOCK_MONOTONIC will not go backwards, while it still
may return the last value (without growth). That behaviour is fully standard
conform and documented.
So, changing the check like this:
- fail_if (tmp <= paused_ns); paused_ns = tmp;
+ fail_if (tmp < paused_ns); paused_ns = tmp;
fixes the testcase on parisc/hppa and alpha platforms (and probably others),
while still keeping the test correct for other platforms.
Can you please apply the attached patch for the next upload and report it
upstream?
Thanks,
Helge
diff -up ./gcs/src/unit_tests/gcs_sm_test.cpp.org ./gcs/src/unit_tests/gcs_sm_test.cpp
--- ./gcs/src/unit_tests/gcs_sm_test.cpp.org 2017-04-26 17:44:45.267964275 +0200
+++ ./gcs/src/unit_tests/gcs_sm_test.cpp 2017-04-27 16:55:47.785062514 +0200
@@ -280,7 +280,7 @@ START_TEST (gcs_sm_test_pause)
long long tmp;
gcs_sm_stats_get (sm, &q_len, &q_len_max, &q_len_min, &q_len_avg,
&tmp, &paused_avg);
- fail_if (tmp <= paused_ns); paused_ns = tmp;
+ fail_if (tmp < paused_ns); paused_ns = tmp;
fail_if (paused_avg <= 0.0);
fail_if (fabs(q_len_avg) > EPS,
"q_len_avg: expected <= %e, got %e", EPS, fabs(q_len_avg));