src/tests: relax assertion for test_nm_utils_monotonic_timestamp_as_boottime()

When running under load (e.g. with parallel make and valgrind
enabled), the checked time interval might be too short. Relax
the assertion

    NetworkManager:ERROR:src/tests/test-general-with-expect.c:65:test_nm_utils_monotonic_timestamp_as_boottime: assertion failed (now_boottime_2 - now_boottime <= NM_UTILS_NS_PER_SECOND / 1000): (15156494 <= 1000000)
This commit is contained in:
Thomas Haller 2016-10-24 15:26:16 +02:00
parent 6df24ee8cc
commit 0846cb98aa

View file

@ -62,7 +62,7 @@ test_nm_utils_monotonic_timestamp_as_boottime (void)
now_boottime_2 = nm_utils_monotonic_timestamp_as_boottime (now, 1);
g_assert_cmpint (now_boottime_2, >=, 0);
g_assert_cmpint (now_boottime_2, >=, now_boottime);
g_assert_cmpint (now_boottime_2 - now_boottime, <=, NM_UTILS_NS_PER_SECOND / 1000);
g_assert_cmpint (now_boottime_2 - now_boottime, <=, NM_UTILS_NS_PER_SECOND / 10);
for (timestamp_ns_per_tick = 1; timestamp_ns_per_tick <= NM_UTILS_NS_PER_SECOND; timestamp_ns_per_tick *= 10) {
now_boottime_3 = nm_utils_monotonic_timestamp_as_boottime (now / timestamp_ns_per_tick, timestamp_ns_per_tick);