summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index a2bf7e1..437a3ba 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -3860,6 +3860,30 @@ test("Repeated primary timeout is sampled from live policy", function()
end, "requires a policy")
end)
+test("Positive repeat timeout reads the current clock", function()
+ local _, transitions = fresh_sequence_state()
+ transitions:SetRepeatTimestamp(25.25)
+ local host = MemoryHost.new({
+ configuration = { repeat_timeout_ms = 100 },
+ time_values_ms = { 125.75 },
+ })
+ local resolver = repeat_resolver.new({
+ clock = host,
+ policy = policy.new(host),
+ })
+
+ local decision, elapsed_ms = resolver:evaluate_timeout()
+ same(nil, decision)
+ same(100.5, elapsed_ms)
+ local reads = 0
+ for _, operation in ipairs(host:operations()) do
+ if operation.operation == "read_time_ms" then
+ reads = reads + 1
+ end
+ end
+ same(1, reads)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then