Skip to content

Remove the time limits of the tests - #795

Merged
fontanf merged 1 commit into
masterfrom
tests-no-time-limit
Nov 4, 2026
Merged

fontanf merged 1 commit into
masterfrom
tests-no-time-limit

Conversation

@fontanf

@fontanf fontanf commented Nov 3, 2026

Copy link
Copy Markdown
Owner

No test should depend on a time limit, except a test of the time limit itself: a time-limited test's result depends on the speed and the load of the machine. For example, IrregularLocalSearchTest on open_dimension_x_mixed_shapes passes or fails depending on the load (see #793).

  • test/irregular/local_search_test.cpp:
    • The parametrized IrregularLocalSearchTest is stopped by maximum_number_of_moves = 10000 instead of a 5 s time limit. Its results are the same from one run to the next. Its longest case takes about 4 s locally (open_dimension_x_mixed_shapes). Without any limit, it would end by itself after about 30 s.
    • The time limits of the feasibility tests (30 s for the direct trigonometry engine, 60 s for the nonlinear programming and black-box optimization engines) are removed: they stop by themselves when a feasible solution is found, or after the maximum number of failed separations.
  • python/tests/test_leftover_modes.py: the solves use the NotAnytimeSequential optimization mode instead of a 2 s time limit.

Tests: the local search tests pass locally in 2 runs out of 2, and test_leftover_modes.py passes (0.3 s). The nonlinear programming and black-box optimization tests need Knitro, so they weren't run locally.

The parametrized local search tests are stopped by a limit on the number
of moves instead of a time limit of 5 s, so that their results don't
depend on the speed of the machine. The feasibility tests of the local
search and the leftover modes tests stop by themselves, without time
limit, with a not-anytime optimization mode for the latter.
@fontanf
fontanf force-pushed the tests-no-time-limit branch from d1d661b to e404a72 Compare November 4, 2026 06:56
@fontanf
fontanf merged commit a6a91eb into master Nov 4, 2026
13 checks passed
@fontanf
fontanf deleted the tests-no-time-limit branch November 4, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant