Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tests/test_coupled_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,12 @@ def test_coupled_memory_and_targeted_searches_stop_at_an_expired_deadline() -> N
# separating_optima takes no deadline; keep it out of the timed region (slow CI runners)
_best, optima = cg.separating_optima(problem, starts=10, rng=np.random.default_rng(0))
start = time.monotonic()
results = cg.coupled_search(bidir, 3, starts=50, deadline=time.monotonic(), rng=np.random.default_rng(0))
# strictly in the past: before Python 3.13, time.monotonic() on Windows ticks every 15.6 ms
expired = start - 1.0
results = cg.coupled_search(bidir, 3, starts=50, deadline=expired, rng=np.random.default_rng(0))
assert results and all(r.residual <= 1e-6 for r in results)
lifts = cg.memory_lift_search(bidir, 2, starts=50, deadline=time.monotonic(), rng=np.random.default_rng(0))
lifts = cg.memory_lift_search(bidir, 2, starts=50, deadline=expired, rng=np.random.default_rng(0))
assert len(lifts) == 1
seeds = cg.targeted_line_split_seeds(problem, optima, deadline=time.monotonic(), rng=np.random.default_rng(0))
seeds = cg.targeted_line_split_seeds(problem, optima, deadline=expired, rng=np.random.default_rng(0))
assert seeds == []
assert time.monotonic() - start < 120
Loading