Skip to content

Fix and test timeout parameter bug#2

Merged
r33drichards merged 1 commit intomainfrom
claude/test-timeout-param-011CUy9jAEPmv5YBG1E17Aok
Nov 9, 2025
Merged

Fix and test timeout parameter bug#2
r33drichards merged 1 commit intomainfrom
claude/test-timeout-param-011CUy9jAEPmv5YBG1E17Aok

Conversation

@r33drichards
Copy link
Owner

The minizinc Python library deprecated the 'timeout' parameter in favor of 'time_limit'. This fix changes the solve_async call to use the correct parameter name, ensuring timeouts work as expected.

Changes:

  • Updated main.py to use time_limit instead of timeout parameter
  • Added comprehensive timeout test that verifies timeout actually interrupts long-running computations (14-queens problem with all_solutions)
  • Test verifies solver stops around timeout duration and returns partial results

The new test uses a 14-queens problem (365,596 total solutions) with a 2-second timeout and verifies:

  1. Solver stops within expected time range (1.5-5 seconds)
  2. Partial solutions are returned (not all 365k solutions)
  3. Status indicates incomplete solving (SATISFIED, not ALL_SOLUTIONS)

The minizinc Python library deprecated the 'timeout' parameter in favor of
'time_limit'. This fix changes the solve_async call to use the correct
parameter name, ensuring timeouts work as expected.

Changes:
- Updated main.py to use time_limit instead of timeout parameter
- Added comprehensive timeout test that verifies timeout actually interrupts
  long-running computations (14-queens problem with all_solutions)
- Test verifies solver stops around timeout duration and returns partial results

The new test uses a 14-queens problem (365,596 total solutions) with a 2-second
timeout and verifies:
1. Solver stops within expected time range (1.5-5 seconds)
2. Partial solutions are returned (not all 365k solutions)
3. Status indicates incomplete solving (SATISFIED, not ALL_SOLUTIONS)
@r33drichards r33drichards merged commit d15c515 into main Nov 9, 2025
1 check passed
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.

2 participants