Skip to content

Python: remove the time limits from the tests - #629

Merged
fontanf merged 1 commit into
masterfrom
python-tests-remove-time-limits
Oct 3, 2026
Merged

fontanf merged 1 commit into
masterfrom
python-tests-remove-time-limits

Conversation

@fontanf

@fontanf fontanf commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Problem

Several Python tests ran with a time limit. Their result then depends on the speed of the machine, which isn't reliable on the CI runners. That's how test_time_limit failed on Windows in #616. The C++ unit tests no longer use time limits (#622).

Fix

Tests Before After
test_time_limit (onedimensional, rectangle, boxstacks) checked the time limit itself removed
quiet_parameters (irregular, boxstacks) 10 s limit, non-anytime mode no limit
LP and column generation tests (box, onedimensional, rectangle, rectangleguillotine) 10 or 30 s limit, anytime mode NotAnytimeSequential, no limit
optimize helpers of test_infeasibility.py and test_item_fits.py 5 s limit, anytime mode NotAnytimeSequential, no limit
boxstacks axle weight test 5 s limit no limit
test_keyboard_interrupt (rectangle, boxstacks) 60 s limit, in case the interrupt didn't work no limit
test_parameters (all types) set a 1.5 s limit, then optimized with it still checks the setter, but resets the limit before optimizing

The unused large_bin_packing_instance helper of the onedimensional tests is removed.

Testing

Tests run with a time limit depend on the speed of the machine, so they
aren't reliable on the CI runners.

- Remove the 'test_time_limit' tests (onedimensional, rectangle,
  boxstacks), which only checked the time limit.
- Remove the time limit of the 'quiet_parameters' helpers (irregular,
  boxstacks), of the axle weight test and of the keyboard interrupt tests.
- The tests of the LP and column generation algorithms (box,
  onedimensional, rectangle, rectangleguillotine) and the 'optimize'
  helpers of 'test_infeasibility.py' and 'test_item_fits.py' ran in
  anytime mode with a time limit: they now run in 'NotAnytimeSequential'
  mode without one.
- 'test_parameters' still checks the 'time_limit' setter, but resets it
  before optimizing.
@fontanf
fontanf merged commit 2d3efec into master Oct 3, 2026
11 checks passed
@fontanf
fontanf deleted the python-tests-remove-time-limits branch October 3, 2026 12:29
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