summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolaus Rath <Nikolaus@rath.org>2016-02-23 15:44:51 -0800
committerNikolaus Rath <Nikolaus@rath.org>2018-12-28 20:04:28 +0000
commit856bceab7c18c595e6fd2fca1bfaa47bf9e6d070 (patch)
tree8e5cc1bdb26d3d0e07e5471ab5f9a8fc2afd8b60
parentc2edae1f2556c10dd47b6920c29f8c9005f08820 (diff)
Estimate system clock granularity more conservatively
Origin: debian Forwarded: no Patch-Name: clock-granularity.diff Some unit tests check that file access time stamps are updated correctly. For such a test to succeed, it's necessarily that the time between two subsequent test-accesses can actually be resolved. The heuristic to determine this granularity doesn't seem to work well on e.g. the i386 buildd, so we make it much more conservative. This means the test suite runs longer, but otherwise has no ill effects. Gbp-Pq: Name clock-granularity.diff
-rw-r--r--tests/common.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/common.py b/tests/common.py
index 8c3be59..bea2e5c 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -27,7 +27,7 @@ def get_clock_granularity():
stamp2 = time.time()
resolution = min(resolution, stamp2 - stamp1)
time.sleep(0.01)
- return resolution
+ return max(1, 10 * resolution)
CLOCK_GRANULARITY = get_clock_granularity()
# When testing, we want to make sure that we don't sleep for too short a time