From d1edd420463cdda399d8acb8124b137cbfd7a898 Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 11:06:13 +0200 Subject: Sample primary repeat timeout --- tests/run.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/run.lua b/tests/run.lua index b010908..a2bf7e1 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -3843,6 +3843,23 @@ test("Primary eligibility repeats at a matching numeric landing", function() ) end) +test("Repeated primary timeout is sampled from live policy", function() + fresh_sequence_state() + local host = MemoryHost.new({ + configuration = { repeat_timeout_ms = 75 }, + }) + local resolver = repeat_resolver.new({ + policy = policy.new(host), + }) + + same(75, resolver:sample_repeat_timeout_ms()) + host:set_configuration("repeat_timeout_ms", 125) + same(125, resolver:sample_repeat_timeout_ms()) + fails(function() + repeat_resolver.new():sample_repeat_timeout_ms() + end, "requires a policy") +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then -- cgit v1.2.3