From 400abf115552ef51efc4f24a9f7c2d3216bc6851 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 6 Oct 2023 10:51:52 -0400 Subject: [PATCH] make test more explicit --- test/test.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.ml b/test/test.ml index 7053d42..de9031b 100644 --- a/test/test.ml +++ b/test/test.ml @@ -260,12 +260,12 @@ end = struct io_assert "Can't check expiration timeout for key" (function None -> false | Some x -> x >= 4 && x <= 6) >>= fun () -> - let pexpiry = int_of_float (Unix.time ()) * 1000 + 1000 in + let pexpiry = int_of_float (Unix.gettimeofday () *. 1000. +. 1000.) in Client.pexpireat conn key pexpiry >>= io_assert "Can't set expiration timeout for key (in ms)" ((=) true) >>= fun () -> Client.pttl conn key >>| function | Some pttl -> - assert_bool "Expiration timeout differs from setted" (0 <= pttl && pttl <= 1000) + assert_bool (Printf.sprintf "Expiration timeout differs from setted (by %dms)" pttl) (0 <= pttl && pttl <= 1000) | None -> assert_failure "Can't check expiration timeout for key"