Closed dhardy closed 6 years ago
Experiment: which platforms fail? https://travis-ci.org/dhardy/rand/builds/304256548
Result: from the platforms we test, only x64_64-apple-darwin
.
It is a bit strange, but I didn't add test to JitterRng
for a reason. The unoptimised code with all the debug checks messes up the timer measurements. The intervals are much higher and more constant. Should have added a comment saying so...
I now see it is part of the benchmarks. That is strange! I wonder if it happens on real macs, or somehow depends on Travis' machines.
Yes, I wonder. It could simply be that std::time::SystemTime
uses a low-precision API.
The FreeBSD nightly failed too (unknown error). Whatever, we can make do with just one nightly test.
The documentation of jitterentropy say clock_gettime
on Mac OS increments in steps of 1000, and that we should be using mach_absolute_time
.
std::time::SystemTime
uses clock_gettime
, while std::time::Instant
uses mach_absolute_time
. But there is no way to get the raw values out of an Instant
, so I think we have to call mach_absolute_time
ourselves.
I will make a PR and see how it goes (can't test because I have not Apple device).
I would not add a FreeBSD nightly for now. Nightly rustc breaks once in a while because it is not tier 1, I think?
This CI run failed due to
CoarseTimer
: https://travis-ci.org/dhardy/rand/jobs/303686167I'm a bit surprised that it failed on a common platform. Note that this test is part of the benchmark, which is only run in nightly builds, of which we only have two. Should we add regular tests? Should we simply not test JitterRng because we can't expect it to run on all platforms?