mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-13 05:42:38 +00:00
events test: the stamp is within a minute of a second clock read, not ordered against it
Review follow-up on #1766: a backward wall-clock step between the push and the test read made the ordering assertion flaky. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
7bee269c4d
commit
12c9acbf0c
1 file changed
+2
-1
@@ -53,7 +53,8 @@ fn events_are_stamped_with_the_wall_clock() {
|
||||
let r = log.poll(0, &comments(), 10, Duration::ZERO);
|
||||
let now = web_time::SystemTime::now().duration_since(web_time::UNIX_EPOCH).unwrap().as_secs_f64();
|
||||
let time = r.events[0].time;
|
||||
assert!(time > 1_700_000_000.0 && time <= now, "{time} is seconds since the Unix epoch, read just before {now}");
|
||||
// Within a minute of the same clock read afterwards (not ordered: the wall clock can step).
|
||||
assert!(time > 1_700_000_000.0 && (time - now).abs() < 60.0, "{time} is seconds since the Unix epoch, read next to {now}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user