fix inconsistent test handling on Windows
Bazel sets TZ to UTC when running tests, so the tests are reproducible. But it seems like the Rust time crate was not honoring it, and using the configured timezone instead. "Fix" by forcing UTC when testing, as we already special-case a test run.
This commit is contained in:
parent
8f0c8b6f8a
commit
88e2aba93c
@ -66,7 +66,7 @@ fn elapsed() -> time::Duration {
|
||||
let mut elap = time::SystemTime::now()
|
||||
.duration_since(time::SystemTime::UNIX_EPOCH)
|
||||
.unwrap();
|
||||
let now = Local::now();
|
||||
let now = Utc::now();
|
||||
if now.hour() >= 2 && now.hour() < 4 {
|
||||
elap -= time::Duration::from_secs(60 * 60 * 2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user