I’m looking for advice on the best way to test code that is executed only when the termination status for optimization returns a status of MathOptInterface.TIME_LIMIT
.
The first approach I tried was to construct models that are difficult to deal with for the optimizer (but easy to understand for the human tester) and setting a short time limit (seconds => 1
with Cbc
) to try to cause MathOptInterface.TIME_LIMIT
to be hit. I haven’t had much success as the solver heuristics seem quite good.
I’ve also considered mocking the function call to JuMP.termination_status
via (GitHub - invenia/Mocking.jl: Allows Julia function calls to be temporarily overloaded for purpose of testing or https://github.com/burrowsa/Fixtures.jl).
Is there any option I’m missing?