mechmotum / cyipopt

Cython interface for the interior point optimzer IPOPT
Eclipse Public License 2.0
227 stars 54 forks source link

Flaky failure of TestSLSQP::test_minimize_unbounded_approximated on x86_64 #238

Closed musicinmybrain closed 9 months ago

musicinmybrain commented 10 months ago

While working on updating the python-cyipopt package in Fedora Linux to 1.3.0, I observed that on x86_64 (only—not on aarch64, ppc64le, or s390x—although with i686 not tested), TestSLSQP::test_minimize_unbounded_approximated frequently fails. I observed that two out of five scratch-builds failed.

=================================== FAILURES ===================================
________________ TestSLSQP.test_minimize_unbounded_approximated ________________
self = <cyipopt.tests.unit.test_scipy_ipopt_from_scipy.TestSLSQP object at 0x7fc6d5629c70>
    def test_minimize_unbounded_approximated(self):
        # Minimize, method=None: unbounded, approximated jacobian.
        jacs = [None, False]
        for jac in jacs:
            res = minimize(self.fun, [-1.0, 1.0], args=(-1.0, ),
                           jac=jac, method=None,
                           options=self.opts)
>           assert_(res['success'], res['message'])
E           AssertionError: b'Algorithm stopped at a point that was converged, not to "desired" tolerances, but to "acceptable" tolerances (see the acceptable-... options).'
cyipopt/tests/unit/test_scipy_ipopt_from_scipy.py:158: AssertionError

The scipy package is at version 1.11.1. I’m happy to run any tests or add any other details that might be helpful.

moorepants commented 9 months ago

Fixed in a2d7dd5110c1f3609168289310ba49132e2abe76

moorepants commented 9 months ago

I decided to just allow the "failure", as it does converge to the acceptable_tol, just not the desired tolerance.