Issue 1:
Describe your issue.

Running the full test suite on macosx_arm64 results in a failed test for optimize.milp

Reproducing Code Example

python dev.py test

Error message

________________________________________________________ test_milp_timeout_16545[options0-Time limit reached. (HiGHS Status 13:] ________________________________________________________
scipy/optimize/tests/test_milp.py:323: in test_milp_timeout_16545
assert res.message.startswith(msg)
E AssertionError: assert False
E + where False = <built-in method startswith of str object at 0x42180c650>('Time limit reached. (HiGHS Status 13:')
E + where <built-in method startswith of str object at 0x42180c650> = 'Optimization terminated successfully. (HiGHS Status 7: Optimal)'.startswith
E + where 'Optimization terminated successfully. (HiGHS Status 7: Optimal)' = message: Optimization terminated successfully. (HiGHS Status 7: Optimal)\n success: True\n status...00 0.000e+00 ... 0.000e+00 0.000e+00]\n mip_node_count: 2715\n mip_dual_bound: -11.00000000000001\n mip_gap: 0.0.message
A = array([[1, 2, 2, ..., 4, 0, 0],
[4, 1, 2, ..., 0, 4, 4],
[4, 1, 1, ..., 1, 4, 3],
...,
[4, 0, 4, ..., 4, 1, 3],
[4, 1, 3, ..., 2, 0, 2],
[2, 2, 1, ..., 2, 1, 2]])
b_lb = array([-inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf,
-inf, -inf, -inf, -inf, -inf, -inf, -i...f, -inf, -inf, -inf, -inf, -inf,
-inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf,
-inf])
b_ub = array([25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, ...25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25])
c_vector = array([-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1.,... -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1., -1.])
constraints = <scipy.optimize._constraints.LinearConstraint object at 0x42171ffd0>
integrality = array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., ...1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
msg = 'Time limit reached. (HiGHS Status 13:'
options = {'time_limit': 10}
res = message: Optimization terminated successfully. (HiGHS Status 7: Optimal)
success: True
status...00 0.000e+00 ... 0.000e+00 0.000e+00]
mip_node_count: 2715
mip_dual_bound: -11.00000000000001
mip_gap: 0.0
rng = Generator(PCG64) at 0x42185C580
variable_bounds = Bounds(array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0...., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]))
variable_lb = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., ...0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
variable_ub = array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., ...1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
================================================================================ short test summary info ================================================================================
FAILED scipy/optimize/tests/test_milp.py::test_milp_timeout_16545[options0-Time limit reached. (HiGHS Status 13:] - AssertionError: assert False

SciPy/NumPy/Python version and system information

1.24.2 sys.version_info(major=3, minor=11, micro=3, releaselevel='final', serial=0)

scipy main

Issue 2:
Describe your issue.

When I run the optimize tests with the main development branch (version 1.10.0.dev0+1987.fa3276a), the test test_milp_timeout_16545 often (but not always!) fails.

Reproducing Code Example

$ python dev.py test -m full -j 9 -s optimize
💻 ninja -C /home/warren/repos/git/forks/scipy/build
ninja: Entering directory `/home/warren/repos/git/forks/scipy/build'
[2/2] Generating scipy/generate-config with a custom command
Build OK
💻 meson install -C build --only-changed
Installing, see meson-install.log...
Installation OK
SciPy from development installed path at: /home/warren/repos/git/forks/scipy/build-install/lib/python3.10/site-packages
Running tests for scipy version:1.10.0.dev0+1987.fa3276a, installed at:/home/warren/repos/git/forks/scipy/build-install/lib/python3.10/site-packages/scipy
============================================================== test session starts ===============================================================
platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/warren/repos/git/forks/scipy, configfile: pytest.ini
plugins: forked-1.4.0, timeout-2.1.0, hypothesis-6.35.0, xdist-2.5.0
gw0 [2281] / gw1 [2281] / gw2 [2281] / gw3 [2281] / gw4 [2281] / gw5 [2281] / gw6 [2281] / gw7 [2281] / gw8 [2281]
.......................................................................................................................................... [ 6%]
..................................................................................................................................ss...... [ 12%]
.......................................................................................................................................... [ 18%]
.........................................................................................s................................................. [ 24%]
..................................................................................................s...X.........s.sX...................... [ 30%]
.......................s.................................................................................................................. [ 36%]
...........ssssss.s..................................................................................x.................................... [ 42%]
.........................................x................................................................................................ [ 48%]
.......................................................................................................................................... [ 54%]
................................................................s......s.s................................................................ [ 60%]
.....................................X.............................X................X.....................................X............... [ 66%]
.........................................................................s..ss.ssss.s.s...ss...ssss..ssss..ssss.ss.ss.ss.s.sss..ssss..ssss [ 72%]
.s.sss.ss.s.ss.ss..ssss.sss.ss.s.ss.ss.ss..sss.ss.ss.s..s.s....s..s..ss...ss.........................s.sss..sss.s.sss.ss..ssss.sss..sss.ss [ 78%]
.ss.ss..sss.sss.ss..sss.ss.ss.ss.ss.ss.s.ss.ss.ss..ss.sss.sss.ss.ss..ss.ss.ssss.s.s..s.ss.s.s............................................. [ 84%]
..................................................................x....................................................................... [ 90%]
.................................................................................................................................x........ [ 96%]
............................................F...................X....... [100%]
==================================================================== FAILURES ====================================================================
____________________________________ test_milp_timeout_16545[options0-Time limit reached. (HiGHS Status 13:] _____________________________________
[gw5] linux -- Python 3.10.1 /home/warren/py3.10.1/bin/python
scipy/optimize/tests/test_milp.py:307: in test_milp_timeout_16545
assert res.message.startswith(msg)
E AssertionError: assert False
E + where False = <built-in method startswith of str object at 0x7f6878265450>('Time limit reached. (HiGHS Status 13:')
E + where <built-in method startswith of str object at 0x7f6878265450> = 'Optimization terminated successfully. (HiGHS Status 7: Optimal)'.startswith
E + where 'Optimization terminated successfully. (HiGHS Status 7: Optimal)' = message: Optimization terminated successfully. (HiGHS Status 7: Optimal)\n success: True\n status...00 0.000e+00 ... 0.000e+00 0.000e+00]\n mip_node_count: 2715\n mip_dual_bound: -11.00000000000001\n mip_gap: 0.0.message
A = array([[1, 2, 2, ..., 4, 0, 0],
[4, 1, 2, ..., 0, 4, 4],
[4, 1, 1, ..., 1, 4, 3],
...,
[4, 0, 4, ..., 4, 1, 3],
[4, 1, 3, ..., 2, 0, 2],
[2, 2, 1, ..., 2, 1, 2]])
b_lb = array([-inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf,
-inf, -inf, -inf, -inf, -inf, -inf, -i...f, -inf, -inf, -inf, -inf, -inf,
-inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf,
-inf])
b_ub = array([25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, ...25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25])
c_vector = array([-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1.,... -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1., -1.])
constraints = <scipy.optimize._constraints.LinearConstraint object at 0x7f6878230f70>
integrality = array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., ...1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
msg = 'Time limit reached. (HiGHS Status 13:'
options = {'time_limit': 10}
res = message: Optimization terminated successfully. (HiGHS Status 7: Optimal)
success: True
status...00 0.000e+00 ... 0.000e+00 0.000e+00]
mip_node_count: 2715
mip_dual_bound: -11.00000000000001
mip_gap: 0.0
rng = Generator(PCG64) at 0x7F6882521540
variable_bounds = Bounds(array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0...., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]))
variable_lb = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., ...0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
variable_ub = array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., ...1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
============================================================ short test summary info =============================================================
FAILED scipy/optimize/tests/test_milp.py::test_milp_timeout_16545[options0-Time limit reached. (HiGHS Status 13:] - AssertionError: assert False
======================================= 1 failed, 2084 passed, 185 skipped, 4 xfailed, 7 xpassed in 40.64s =======================================

Error message

See above.

SciPy/NumPy/Python version information

1.10.0.dev0+1987.fa3276a 1.24.0.dev0+837.g9c5a2b41c sys.version_info(major=3, minor=10, micro=1, releaselevel='final', serial=0)