Fix test_milp_timeout failure

Resolves: rhbz#2172559
This commit is contained in:
Charalampos Stratakis 2023-05-10 03:14:04 +02:00
parent 9b52d22960
commit abd90e546d
2 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,53 @@
From 9b068e5a68d9efd9c2403e9499b2c381b6c1d3a6 Mon Sep 17 00:00:00 2001
From: Matt Haberland <mhaberla@calpoly.edu>
Date: Fri, 21 Apr 2023 07:07:41 -0700
Subject: [PATCH 1/2] MAINT: optimize: fix test_milp_timeout
---
scipy/optimize/tests/test_milp.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/scipy/optimize/tests/test_milp.py b/scipy/optimize/tests/test_milp.py
index 51996642..1f60fce3 100644
--- a/scipy/optimize/tests/test_milp.py
+++ b/scipy/optimize/tests/test_milp.py
@@ -279,9 +279,7 @@ _msg_iter = "Iteration limit reached. (HiGHS Status 14:"
@pytest.mark.skipif(np.intp(0).itemsize < 8,
reason="Unhandled 32-bit GCC FP bug")
-@pytest.mark.slow
-@pytest.mark.timeout(360)
-@pytest.mark.parametrize(["options", "msg"], [({"time_limit": 10}, _msg_time),
+@pytest.mark.parametrize(["options", "msg"], [({"time_limit": 0.1}, _msg_time),
({"node_limit": 1}, _msg_iter)])
def test_milp_timeout_16545(options, msg):
# Ensure solution is not thrown away if MILP solver times out
--
2.40.0
From 024568a4f4292e7b22643f40ae61d33d273cf674 Mon Sep 17 00:00:00 2001
From: Matt Haberland <mhaberla@calpoly.edu>
Date: Sat, 22 Apr 2023 15:43:07 -0700
Subject: [PATCH 2/2] Update scipy/optimize/tests/test_milp.py
[skip ci]
---
scipy/optimize/tests/test_milp.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scipy/optimize/tests/test_milp.py b/scipy/optimize/tests/test_milp.py
index 1f60fce3..42dae29a 100644
--- a/scipy/optimize/tests/test_milp.py
+++ b/scipy/optimize/tests/test_milp.py
@@ -279,6 +279,7 @@ _msg_iter = "Iteration limit reached. (HiGHS Status 14:"
@pytest.mark.skipif(np.intp(0).itemsize < 8,
reason="Unhandled 32-bit GCC FP bug")
+@pytest.mark.slow
@pytest.mark.parametrize(["options", "msg"], [({"time_limit": 0.1}, _msg_time),
({"node_limit": 1}, _msg_iter)])
def test_milp_timeout_16545(options, msg):
--
2.40.0

View File

@ -22,7 +22,7 @@
Summary: Scientific Tools for Python
Name: python%{python3_pkgversion}-scipy
Version: 1.10.1
Release: 1%{?dist}
Release: 2%{?dist}
# BSD -- whole package except:
# Boost -- scipy/special/cephes/scipy_iv.c
@ -31,6 +31,11 @@ License: BSD and Boost and Public Domain
Url: http://www.scipy.org/scipylib/index.html
Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz
# Fix test_milp_timeout failure
# Resolved upstream: https://github.com/scipy/scipy/pull/18339
Patch0: fix_test_milp_timeout.patch
BuildRequires: fftw-devel, suitesparse-devel
BuildRequires: %{blaslib}-devel
BuildRequires: gcc-gfortran, swig, gcc-c++
@ -213,6 +218,9 @@ popd
%{python3_sitearch}/*.egg-info
%changelog
* Wed May 10 2023 Charalampos Stratakis <cstratak@redhat.com> - 1.10.1-2
- Fix test_milp_timeout failure
* Tue May 02 2023 Ryan Erickson <rerickso@redhat.com> - 1.10.1-1
- Update to 1.10.1